lotus domino foundation skills
TRANSCRIPT
IBM Software Services for Lotus
Developing IBM® Lotus® Domino™ 6 Applications: Foundation Skills Instructor Guide
Preview
Copyright, Disclaimer of Warranties and Limitation of Liability
© Copyright IBM Corporation 2002.
Lotus software, IBM Software GroupOne Rogers StreetCambridge, MA 02142
All rights reserved. Printed in the United States.
IBM, LearningSpace, Lotus, Lotus Notes, LotusScript, Sametime, and TeamRoom are registered trademarks and Domino, Domino.Doc, Domino Extended Search, Domino Workflow, K-station, Notes, QuickPlace, and the e-business logo are trademarks of International Business Machines Corporation. All other product or brand names may be trademarks of their respective companies.
You must purchase one copy of the appropriate kit for each student and each instructor. For all other education products you must acquire one copy for each user.
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 written consent of IBM Corporation, except in the manner described in the documentation.
While every reasonable precaution has been taken in the preparation of this manual, the author and publishers assume no responsibility for errors or omissions, nor for the uses made of the material contained herein and the decisions based on such use. Neither the author nor the publishers make any representations, warranties, or guarantees of any kind, either express or implied (including, without limitation, any warranties of merchantability, fitness for a particular purpose, or title). Neither the author nor the publishers shall be liable for any indirect, special, incidental, or consequential damages arising out of the use or inability to use the contents of this book, and each of their total liability for monetary damages shall not exceed the total amount paid to such party for this book.
The term ‘Preview’ in the document header, denotes that this education manual has not been copyedited, formatted or otherwise quality tested for final print production. This manual has been prepared for the purpose of providing you with a preliminary version of the final courseware. This manual shall become obsolete with the availability of the final version of the courseware.
IBM offers the widest range of server platforms for Lotus Domino, including the Intel processor-based Netfinity server family. With Netfinity servers, solutions ranging from simple e-mail to unified messaging to Web site hosting and collaborative applications such as distance learning and knowledge management are confidently executed. Both the Quality Assurance Engineering and Curriculum Development departments, within Lotus' education line of business, utilize Netfinity servers to develop and test the company's education offerings. Domino's functionality combined with the IBM mark of reliability on the Netfinity product family differentiates Lotus from its competition. With more than 70% of the world’s data residing on IBM systems, and with the innovative software products and services from Lotus Development, IBM and Lotus are taking connectivity to a new level in all aspects of business — from document management to e-business.
Preview
Table of Contents
Topic Page #
Developing IBM Lotus Domino 6 Applications: Foundation Skills
Course Description and Strategy ..........................................................1Course Description ........................................................................................... 2Course Strategy ................................................................................................ 4
Instructor Preparation ............................................................................7Course Materials .............................................................................................. 8Preparation Checklist ..................................................................................... 10CLI Certification Requirements ....................................................................... 13
Classroom Setup ..................................................................................15Machine Requirements ................................................................................... 16Classroom Setup Overview ............................................................................ 18
Classroom Setup Instructions ...................................................................... 21
Module A: Exploring IBM Lotus Domino 6 and Domino Designer 6 ...............................................................................35
Lesson 1 Introduction to IBM Lotus Domino 6 ............................................ 36What is IBM Lotus Domino 6? ..................................................................... 38Examining a Domino Database ................................................................... 40Creating a Domino Database ...................................................................... 44Creating copies of the course databases .................................................... 46How Domino Stores Information .................................................................. 50Accessing Data in a Note ............................................................................ 54Analyzing Documents Exercise ................................................................... 58Using the Notes Client to Access A Domino Application ............................. 60Using a Web Browser to Access Domino Applications ............................... 64
Lesson 2 Exploring Domino Designer 6 ...................................................... 66Accessing a Database Design ..................................................................... 68Accessing Design Elements ........................................................................ 70Managing the Designer Environment .......................................................... 76The Course Files ......................................................................................... 78
Module B: Working with Design Elements .........................................81Lesson 3 Working with Forms ..................................................................... 82Defining Forms ............................................................................................ 84Designing a Form ........................................................................................ 90Creating a Form ........................................................................................... 92Adding Text to a Form ............................................................................... 102Previewing Your Work ............................................................................... 106Adding Tables to a Form ............................................................................ 108Creating Fields .......................................................................................... 112Working with Text Data .............................................................................. 120
Preview
Table of Contents
Topic Page #
Working with Numeric Data ....................................................................... 132Working with Date/Time Data .................................................................... 134Using Hide/When Options ......................................................................... 136Exercise: Create a database, and a form that contains a table and fields . 144
Lesson 4 Working With Views .................................................................. 146Introducing Views ...................................................................................... 148Designing a View ....................................................................................... 156Creating the View ...................................................................................... 158Selecting Documents for a View ................................................................ 164Displaying Information in View Columns ................................................... 172Organizing Documents in a View ............................................................... 180Formatting a View ...................................................................................... 192Exercise: Create a Categorized View ........................................................ 194
Lesson 5 Working with Pages ................................................................... 196What Are Pages? ...................................................................................... 198Differences Between Forms and Pages .................................................... 204Creating a Page ......................................................................................... 206Setting Page Properties ............................................................................. 208Incorporating Graphics .............................................................................. 212Using Shared Resources ........................................................................... 218Using Image Resources ............................................................................ 220What Are Sections? ................................................................................... 228Creating Sections ...................................................................................... 230Displaying Pages in Domino Designer ...................................................... 232Exercise: Create A Page ........................................................................... 234
Module C: Programming in Domino Applications ...........................237Lesson 6 Introducing Formula Language ................................................. 238Working with the Formula Language ......................................................... 240Triggering Events ....................................................................................... 244Computing and Comparing Values ............................................................ 248Computing and Comparing Values ............................................................ 254Working with @Functions .......................................................................... 256Formatting and Commenting Formulas ..................................................... 260Exercise: Interpret Formulas ..................................................................... 264
Lesson 7 Using Formula Language in Forms ........................................... 266Adding Code to a Form ............................................................................. 268Creating a Window Title ............................................................................ 270Displaying Computed Values ..................................................................... 274Exercise: Create a Dynamic Title for the Policy Form ............................... 278Storing Computed Values .......................................................................... 280Translating Field Values ............................................................................ 284Validating Field Values ............................................................................... 288Exercise: Automate Data Entry and Formatting ........................................ 292Working with Lists ...................................................................................... 294
Preview
Table of Contents
Topic Page #
Computing the Choices in List Fields ........................................................ 298Exercise: Compute a List of Choices for a Field ........................................ 302Interfacing with the User ............................................................................ 304Creating Reusable Code ........................................................................... 308Exercise: Create Reusable Code .............................................................. 310
Module D: Enhancing Design Elements ...........................................313Lesson 8 Enhancing Forms ...................................................................... 314Working with Layers .................................................................................. 316Positioning Layers ..................................................................................... 324Hiding Layers ............................................................................................. 328Work with Layers ....................................................................................... 330Working with Subforms .............................................................................. 332Working with Shared Fields ....................................................................... 344Inheriting Information ................................................................................. 348Creating Related Forms ............................................................................ 358Exercise: Create Question and Answer Forms in the Policies Database .. 368
Lesson 9 Enhancing Views ....................................................................... 372Writing View Selection Formulas ............................................................... 374Concatenating Values in a View Column ................................................... 380Creating a Hierarchical View ..................................................................... 386Displaying Response Data in the View ...................................................... 388Exercise: Display the Question and Answer Documents in a View ........... 392
Module E: Automating Tasks .............................................................395Lesson 10 Using Actions to Automate Tasks .............................................. 396Defining Actions ......................................................................................... 398Working with Actions ................................................................................. 402Shared Actions .......................................................................................... 414Controlling How Actions Display ................................................................ 418Action Hotspots ......................................................................................... 428Exercise: Adding Automation to the Policies Application .......................... 430
Lesson 11 Using an Agent to Update Documents ...................................... 432Defining Agents ......................................................................................... 434Designing an Agent ................................................................................... 442Creating an Agent ...................................................................................... 452Exercise: Update Existing Documents ...................................................... 456
Module F: Working with Security ......................................................459Lesson 12 Defining Access to a Database ................................................. 460Database Security ..................................................................................... 462Working with Access Control Levels ......................................................... 464Refining Access Control Levels ................................................................. 476Providing Additional Restrictions with User Types .................................... 480Exercise: Set Access Restrictions to the Database ................................... 482
Instructor
Table of Contents
Topic Page #
Lesson 13 Accessing Elements within a Database .................................... 484Setting Roles in a Database ...................................................................... 486Using Roles to Determine What the User Can Do or See ......................... 490Exercise: Create Roles .............................................................................. 496Controlling Access to Documents .............................................................. 498Using Readers Fields ................................................................................ 500Using Authors Fields ................................................................................. 504Controlling Access for Anonymous Users ................................................. 510Exercise: Control access to documents in the Policies and Procedures application .............................................................................. 514
Module G: Deploying the Application................................................517Lesson 14 Preparing and Deploying the Application ................................... 518Controlling Application Maintenance .......................................................... 520Database Templates................................................................................... 522Using Master Design Templates................................................................. 524Exercise: Create a design template and a new database .......................... 530Describing the Domino Replication Service ............................................... 532Controlling What Replicates ....................................................................... 536Creating Replicas ....................................................................................... 540Exercise: Roll out the Policies application .................................................. 542
Appendix A: Exercise Solutions
Appendix B: Identifying Programming Languages Supported by Domino
Appendix C: Learning Processes and Instructor Guide Conventions
PreviewCourse Description and Strategy
Course Description and Strategy
Course Description
Lotus Professional Certification
Course Strategy
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 1 © Copyright IBM Corporation 2002. All r ights reserved.
PreviewCourse Descript ion and Strategy
Course Description
Target audience
The target audience for Developing IBM Lotus Domino 6 Applications: Foundation Skills is Application developers new the IBM Lotus Domino environment.
Summary description
This course is a hands-on introduction to the basic skills of working in the IBM Lotus Domino Designer 6 development environment. Through instructor lecture and student-centered activities and exercises, students learn the foundation skills required to use Domino 6 Designer design elements to create Domino 6 applications. By the end of the course, students should be able to design, develop, and deploy a single-database IBM Lotus Domino 6 application.
Course format and duration
This is a four-day classroom course.
Course goals
By the end of the course, students should be able to design, develop, and deploy a single-database IBM Lotus Domino 6 application.
2 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewCourse Description and Strategy
Course Description...(continued)
Topics covered
The Developing IBM Lotus Domino 6 Applications: Foundation Skills course covers the following topics:
Domino 6 application architecture
Domino Designer 6 application and design environment
Creating forms
Adding fields to forms
Creating views
Creating pages
Overview of programming in Domino 6 applications
Working with Formula Language
Creating documents
Enhancing forms and pages with layers
Creating sorted and categorized views
Validating and translating fields
Creating agents to modify data in documents
Creating view and form actions
Defining various security levels for application users
Using hide/when options to display or hide information
Using links to make application elements available to users
Creating different types of links
Creating a design template
Determining replication requirements
Determining information required by system administrators to deploy an application
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 3
l
PreviewCourse Descript ion and Strategy
Course Strategy
Approach
Developing IBM Lotus Domino Designer 6 Applications: Foundation Ski ls is the first of two core courses in the Domino 6 Application Development curriculum. This course takes a full four days to deliver correctly. Our intent with the design of this course is to give the students a solid foundation, hence the name, in designing and developing Domino applications. This course, and its follow-on Intermediate skills course, focuses on the skills needed to develop for the Notes client.
During the first two days of the course, the students learn about working with the basic building blocks in a Domino application along with learning how to work with the Formula language. During the second two days of the course the students learn how to add to the basic building blocks with more advanced functionality. This leads to automating the application and securing it. Also, on the last day students will learn what they need to know to manage an application in a production environment, and what they need to know, or be able to do, to deploy it.
There is no reason not to have the students preview their work in a browser. However, to fully focus on creating Domino applications for the Web, IBM Lotus software offers a course titled Developing Dynamic Web Applications With IBM Lotus Domino 6.
Recommended agenda
The tables on the following two pages describe the recommended agenda for delivering the material over the four days.
4 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewCourse Description and Strategy
Course Strategy...(continued)
Day 1
The following table shows the recommended agenda for Day 1.
Time
30 minutes
Lessons or Topics
Course and Student Introductions
Module A: Exploring IBM Lotus Domino 6 and Domino Designer 6
30 minutes Lesson 1: Introduction to IBM Lotus Domino 6
30 minutes Lesson 2: Exploring Domino Designer
Module B: Working with Design Elements
1 hour Lesson 3: Working with Forms
1 hour Lunch
2 hours Lesson 3: Working with Forms
2 hours Lesson 4: Working with Views
Day 2
The following table shows the recommended agenda for Day 2.
Time Lessons or Topics
Module B: Working with Design Elements
1 hour Lesson 5: Working with Pages
Module C: Programming in Domino Applications
1 hour Lesson 6: Introducing Formula Language
1 hour Lesson 7: Using Formula Language in Form
1 hour Lunch
3 hours 30 minutes
Lesson 7: Using Formula Language in Form
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 5
PreviewCourse Descript ion and Strategy
Course Strategy...(continued)
Day 3
The following table shows the recommended agenda for Day 3.
Time Lessons or Topics
Module D: Enhancing Design Elements
2 hours Lesson 8: Enhancing Forms
1 hour Lunch
1 hour 15 minutes
Lesson 9: Enhancing Views
Module E: Automating Tasks
1 hour 30 minutes
Lesson 10: Using Actions to Automate Tasks
Day 4
The following table shows the recommended agenda for Day 4.
Time Lessons or Topics
Module E: Automating Tasks
1 hour 30 minutes
Lesson 11: Using an Agent to Update Documents
Module F: Working with Security
30 minutes Lesson 12: Defining Access to a Database
1 hour Lunch
1 hour 30 minutes
Lesson 13: Accessing Elements within a Database
Module G: Deploying the Application
1 hour Lesson 14: Preparing and Deploying the Application
6 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewInstructor Preparation
Instructor Preparation Course Materials
Preparation Checklist
CLI Certification Requirements
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 7 © Copyright IBM Corporation 2002. All r ights reserved.
PreviewInstructor Preparation
Course Materials
Instructor kit
The following table lists and describes the content of the instructor kit.
Instructor Kit Content Description
Developing IBM Lotus Domino 6 Applications: Foundation Skills
Contains the following: Course description and strategy Recommended agenda Course materials Preparation checklist CLI certification requirements Classroom setup Hints and tips for successfully teaching the learning processes that will help the students accomplish the lesson objectives.
Course files Support your delivery of the course. The Classroom Setup section describes these files in further detail.
8 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewInstructor Preparation
Course Materials...(continued)
Student kit
The following table lists and describes the content of the student kit.
Student Kit Content Description
Developing IBM Lotus Domino 6 Applications: Foundation Skills
Contains the following: Course description Recommended agenda Lotus professional certification Learning processes Instructional content of the course, including the activities and exercises that will enable the students to accomplish the lesson objective.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 9
PreviewInstructor Preparation
Preparation Checklist
When preparing to teach this course, consider doing the following:
Read through the Student Guide and Instructor Guide.
Perform all activities and exercises in the Student Guide.
Perform all demonstrations and walkthroughs described in the Instructor Guide.
Refer to the Interactive Instructor Guide (IIG) to get updated information on the course.
Refer to the Instructor Lounge to gather useful teaching tips and techniques that other instructors have used to teach this course.
Use the information in this section to find additional resources to further your knowledge of the subject.
Practice the classroom setup.
Learning processes definition
A learning process is a method for presenting course information to students. If you are unfamiliar with the learning processes defined by Lotus Education, please refer to Appendix D: Learning Processes for further clarification.
10 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewInstructor Preparation
Preparation Checklist...(continued)
CLI Private Site
For more information on how to teach this course, refer to the CLI Private Site locate at http://www.lotus.com/cli.
If you have already registered, enter your user name and password to access the Instructor Lounge and other private areas of the Web site to gain additional information for teaching this course.
If you have not registered, visit the Education Zone located at http:// www.lotus.com/educationzone and follow the instructions to register for the certified community. After registering, you will be able to access the CLI Private Site using your user name and password.
Interactive Instructor Guide (IIG) - technical courses
The Interactive Instructor Guide (IIG) is a Domino™database that contains constructive comments from Certified Lotus Instructors (CLIs) who have taught this course. Consult the IIG to learn about courseware issues, resolutions, tips, and techniques for teaching this course. If you have insights you would like to share with other CLIs after teaching this course, please include your comments in the IIG so that other instructors may benefit from your experience.
The IIG is structured so that instructors can:
Provide feedback on courseware.
Submit courseware problem reports.
Share course delivery tips and tools.
Lotus Education monitors this site to provide:
Responses to feedback.
Solutions to courseware problems.
Courseware updates.
You can access the link to the IIG from the CLI Private Site located at http:// www.lotus.com/cli.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 11
PreviewInstructor Preparation
Preparation Checklist...(continued)
Additional instructor preparation information
The following table lists and describes additional resources you can use to prepare to teach this course.
This Resource Will Help You Learn More About...
IBM Redbook titled Performance Considerations for Domino Applications, SG24-5602-00, ISBN: 073841588X
Performance considerations when developing applications for Domino R5.0 or R4.6, including:
How to consider performance and capacity when designing and developing a Domino application
How to analyze a Domino application that does not meet its performance and This book focus on the application perspective.
IBM Redbook titled Lotus Domino Release 5.0: A Developer's Handbook, SG24-5331-01, ISBN: 0738414123
Developing applications for Domino Release 5. Even though this book focuses on the earlier release of Domino, most of the topics are applicable to developing applications for Domino 6. The book describes how to use the programming languages available in Domino Designer; the formula language, LotusScript, JavaScript, Java, IIOP and CORBA, C++ API and the LSX toolkit. Some good practical advice on Domino development do's and don'ts are then outlined before discussing the Domino Enterprise Connector Services (DECS) which are used to access data from external data sources, along with chapters describing how to use NotesSQL, ODBC, and the LotusScript Data Object (LSDO). The book then explains how to create multilingual international applications for Domino and the Web using the Global Workbench tool.
http://www-10.lotus.com/ldd Domino 6 directly from the people who developed the product. This is the Lotus Developer Domain (LDD) site, the premier Web site for technical information about Lotus software from IBM.
12 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewInstructor Preparation
CLI Certification Requirements
CLI Web site
To learn about the requirements for becoming a CLI or to upgrade your current certification, visit the CLI Web site at http://www.lotus.com/home.nsf/welcome/ certification.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 13
PreviewInstructor Preparation
14 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup The following system specifications and setup procedures were used to develop and test this course. If the classroom setup does not match these specifications, Lotus Education makes no guarantee that the learning processes in this course will perform as stated.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 15 © Copyright IBM Corporation 2002. All r ights reserved.
PreviewClassroom Setup
Machine Requirements
Instructor machine requirements
The following table identifies the number of Notes/Domino license types required for the instructor machine(s) for this class.
Notes/Domino License Type
# of Instructor Server Machines
# of Instructor Client Machines
IBM Lotus Domino 6 Enterprise Server
1
IBM Lotus Domino Administrator 6
1
Student machine requirements
The following table identifies the number of Notes/Domino license types required for the student machines for this class.
Notes/Domino License Type
# of Student Server Machines
# of Student Client Machines
IBM Lotus Domino Designer 6 1 per student
16 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Machine Requirements...(continued)
Software and hardware requirements
The following table lists the software and hardware required per instructor and student machine to deliver this course.
Note: Client requirements are per client software installed on machine. If more than one client type is required on certain machines, add the individual client type requirements together.
Software Requirements Minimum Hardware Requirements per
Machine
Recommended Hardware
Requirements per Machine
Network TCP/IP using either Hosts file or DNS with server and domain names defined in the TCP/IP protocol configuration.
Internet access
Instructor servers
Windows 2000 Server with Service Pack 3 Or Windows NT 4 Server with Service Pack 6a
Lotus Domino Server 6
Memory: 256 MB Disk space: 500 MB CD-ROM drive or access to network file server for installation
Support for 256 colors, 800 x 600 resolution
Memory: 512 MB Disk space 1 GB
Instructor and student clients
Windows 2000 with Service Pack 3 (recommended) Or Windows NT 4 with Service Pack 6a
Lotus Domino Administrator or Designer 6
One of the following browsers:
Netscape Navigator 4.7 or above
Internet Explorer 5.5 or above
Microsoft Powerpoint Viewer (Instructor only)
Memory:128MB Disk space: 250 MB CD-ROM drive or access to network file server for installation
Support for 256 colors, 800 x 600 resolution
Synchronize system time with all classroom machines
Memory: 256MB Disk space: 300 MB
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 17
PreviewClassroom Setup
Classroom Setup Overview
Domino naming used in the course
This course uses the following hierarchical naming scheme.
Naming Component Classroom Implementation
Organization certifier /WWCorp
Domain WWCorp
Instructor server Hub/WWCorp
Instructor account Doctor Notes/WWCorp
Student accounts Student ND01/WWCorp Student ND02/WWCorp Student ND03/WWCorp Student ND04/WWCorp Student ND05/WWCorp Student ND06/WWCorp Student ND07/WWCorp Student ND08/WWCorp Student ND09/WWCorp Student ND10/WWCorp Student ND11/WWCorp Student ND12/WWCorp
18 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup Overview...(continued)
Course files
The following tables outline the files used in the course or provided as additional tools.
The following table describes the required course configuration files.
Title File name Function
WWCorp’s Directory Names.nsf Used to set up the classroom servers and administrators
Note: Student ID files are contained in Names.nsf
/WWCorp certifier ID file WWCorp.id
Hub/WWCorp’s ID file Hub.id
Doctor Notes user ID file Dnotes.id
Doctor Notes mail file Dnotes.nsf
User mail files snd01.nsf snd02.nsf snd03.nsf snd04.nsf snd05.nsf snd06.nsf snd07.nsf snd08.nsf snd09.nsf snd10.nsf snd11.nsf snd12.nsf
Student mail files
Domino databases Instructor_ND510.nsf Instructor demonstrations
Practice_ND510.nsf Student practice
Policies.nsf Policies and Procedures
PoliciesCStart.nsf
PoliciesDStart.nsf
PoliciesEStart.nsf
PoliciesFStart.nsf
Supplied graphics ND510_graphics.exe Compressed file of 55 graphics used in the course.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 19
PreviewClassroom Setup
Classroom Setup Overview...(continued)
Course files...
The following table describes the required course presentation files.
Title File name Function
Classroom Diagrams ND510.ppt Used throughout the course to display diagrams used in the classroom.
Animations Rep50.exe PagesForms.exe
Replication concepts An animation executable used to illustrate the differences between pages and forms in Domino Designer 6
20 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
7
8
9
PreviewClassroom Setup
Classroom Setup Instructions
Checklist of classroom setup tasks
Complete the tasks in the following table to set up the classroom prior to the start of class. Detailed procedures for each task appear on the following pages.
The last column in the table indicates a task that you may skip if using the supplied Domino Directory and files.
Task Procedure Skip
Install the Domino server software.
Install the Domino client software.
Install supplied files to instructor machines.
Edit hosts file on each classroom machine.
Set up the Instructor’s server.
Set up the Instructor’s workstation.
Create a student group
Register the student accounts.
Modify security settings in Server document.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 21
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 1: Install the Domino server software
Follow these steps to install the Domino server software.
Repeat this procedure for each student machine in the classroom. For Step 4, enter the user name for that machine based on the classroom configuration diagram.
Step Action
1 Run the Domino 6 server install program, Setup.exe, from a CD or other media.
2 On the Welcome screen, click Next.
3 Read the Lotus Licensing Agreement, then click Yes to agree with the terms.
4 On the next screen, enter the following information and then click Next. Name: Doctor Notes Company: Worldwide Corporation
5 Accept the default folders or click Browse to change the drive on which to install Domino. Use the following directory structure:
Program files: drive:\Lotus\Domino Data files: drive:\Lotus\Domino\data
Click Next.
6 Select Domino Enterprise Server, then click Next to install the default server components.
7 Accept the default group, Lotus Applications, in which to include the Lotus Domino Server program icon, then click Next to begin copying files.
8 Click Finish to complete the installation.
22 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 2: Install the Domino Administrator or Designer client software
Follow these steps to install the Domino client software on the instructor’s workstation.
Step Action
1 Run the Notes 6 client install program, Setup.exe, from a CD or other media.
2 On the Welcome screen, click Next.
3 Read the License Agreement. Select I accept the terms in the license agreement, then click Next.
4 On the next screen, enter the following information then click Next. Name: Doctor Notes Company: Worldwide Corporation
5 Accept the default folders or click Change to change the drive on which to install Notes. Use the following directory structure:
Program files: drive:\program files\Lotus\Notes Data files: drive:\program files\Lotus\Notes\data
Click Next.
6 Select the following option and then click Next to install the default client components.
Notes Client Domino Designer Domino Administrator
7 Accept the default group, Lotus Applications, in which to include the Domino Administrator program icon, then click Next to begin copying files. Note: If you do not see this screen, click Install to begin copying files.
8 Click Finish to complete the installation.
Installing the Domino client software on student machines
For the student machines:
Repeat the procedure for each student machine in the classroom.
For Step 4, enter the user name for that machine.
For Step 6, install the Notes Client and Domino Designer only.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 23
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 3: Install supplied files to the instructor machines
Follow these instructions to install the \ND510 course folder to your server and client.
Step Action
1 Put the course CD in the server or client
2 From the server console, select Start Run.
3 Read the license agreement and click Accept to indicate that you will comply with the agreement.
4 In the Server Setup window, click Next.
5 Review the README.TXT file. Click Next.
6 Choose one of the following options: Click Next to accept the default folder for installation. Click Browse… to select a different directory.
Result: The default directory is c:\ND510.
7 Click Finish to complete the setup. Result: The \ND510 directory is created and populated with the course files.
24 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 3: Install supplied files to the instructor machines...
The setup program will copy the following files to the specified locations creating the necessary directories if required.
Instructor’s server
Directory Files Copied
\Domino\Data\Foundation Instructor_ND510.nsf Practice_ND510.nsf Policies.nsf PoliciesCStart.nsf PoliciesDStart.nsf PoliciesEStart.nsf PoliciesFStart.nsf
\ND510 Names.nsf WWCorp.id Hub.id Dnotes.id
\ND510\Mail Dnotes.nsf snd01.ns snd02.nsf snd03.nsf snd04.nsf snd05.nsf snd06.nsf snd07.nsf snd08.nsf snd09.nsf snd10.nsf snd11.nsf snd12.nsf
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 25
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 3: Install supplied files to the instructor machines...
Instructor’s workstation
Directory Files Copied
Foundation ND510_grahics.exe Rep50.exe PagesForms.exe ND510.ppt
26 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 4: Edit hosts file on each classroom machine
Use any text editor to edit the hosts file on each classroom machine to include the IP address and server name of the instructor machine as follows:
HubIPaddress Hub/WWCorp hub.wwcorp.com www.wwcorp.com
Task 5: Set up the Instructor’s server
Follow these steps to set up the Instructor’s server as the first server in the domain, Hub/WWCorp.
Step Action
1 From Windows, choose Start Programs Lotus Applications Lotus Domino Server.
2 On the Welcome screen, click Next.
3 Select Set up the first server or a stand-alone server, and click Next.
4 Enter the following information: Server name: Hub Server title: Worldwide Corporation Hub server
If using the supplied ID files, complete these steps:
a. Check I want to use an existing server ID file. b. Click Browse to select the Hub.id file, then click Select. Click Next.
5 On the Choose your organization name screen, if not using the supplied files, enter the following information:
Organization name: WWCorp Organization Certifier password: lotusnotes
If using the supplied ID files, complete these steps: Check I want to use an existing certifier ID file. Click Browse to select the WWCorp.id file, then click Select.
Click Next.
6 Enter the password, and click OK.
7 For the Domino domain name, enter WWCorp and click Next.
(continued on next page...)
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 27
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 5: Set up the Instructor’s server...
Step Action
8 On the Specify an Administrator name and password screen, if you are not using the supplied files, than the following fields should already be filled-in. If not, enter the following information:
First name: Doctor Last name: Notes
Enter the Administrator password: lotusnotes If using the supplied ID files, complete these steps:
Check I want to use an existing Administrator ID file. Click Browse to select the Dnotes.id file, then click Select.
Click Next.
9 Enter the password, and click OK.
10 For Internet services, select Web Browsers (HTTP services) and click Next.
11 Review the default enabled port drivers and host name. To change these settings:
Click Customize. Enable or disable any ports, add ports or delete ports. Enter the fully qualified Internet host name for the server, hub.wwcorp.com.
Click OK.
Click Next.
12 On the Secure your Domino Server screen, accept the defaults and click Next.
13 Review the information selected during this session. To confirm setting up the server with this information, click Setup.
14 When setup completes, click Finish.
(continued on next page...)
28 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 5: Set up the instructor’s server...
Step Action
16 Before starting the server, copy the supplied files to their target directories: \Domino\data: Names.nsf \Domino\data\mail: Dnotes.nsf and all the student mail files
17 To start the server from Windows, choose Start Programs Lotus Applications Lotus Domino Server. Note: The server may take several minutes to initialize.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 29
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 6: Set up the Instructor’s workstation
Follow these steps to set up the instructor’s workstation.
Step Action
1 From Windows, choose Start Programs Lotus Applications Lotus Notes.
2 On the Welcome screen, click Next.
3 On the User Information screen, enter: Name: Doctor Notes Domino server: Hub/WWCorp
Check I want to connect to a Domino server, and click Next.
4 If the ID is not found in the Domino Directory, the setup program will request the location of the Notes ID file. To locate the Notes ID file:
Click Browse, select Dnotes.id, then click Open. Click Next. 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 copy the ID file to the local data directory automatically.
5 Enter the password, and click OK.
6 On the Additional Services screen, it is not necessary to select any additional services for this course. Click Next.
7 When the Notes setup is complete, click OK.
8 On the Notes 6 Setup screen, click No thanks, just give me the defaults. Result: The standard Lotus Notes 6 desktop displays.
9 Choose File Preferences User Preferences and click Basics.
10 On the Basics tab in the Additional Options section, select the following options if not already selected and then click OK:
Enable Java applets Enable JavaScript Use Web palette
30 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 7: Create a student group
Note: Skip this step if using the supplied files.
Follow these steps to create a student group. This group is used to set the server security
Step Action
1 From Domino Administrator, select the People & Groups tab Domino Directories section WWCorp’s Directory section Groups view.
2 Click Add Group.
3 For the Group name, enter Students
4 (Optional) Enter a Description, Mail Domain, and Internet Address.
5 Add Doctor Notes to the group.
6 Click Save & Close.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 31
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 8: Register the student accounts
Note: Skip this step if using the supplied files.
Follow these steps to register the student accounts.
Step Action
1 Select the People & Groups tab Domino Directories section WWCorp’s Directory section People view.
2 Choose Tools People Register.
3 Click Certifier ID and select Wwcorp.id. Click OK.
4 Enter lotusnotes for the password, and click OK.
5 Select Advanced.
6 On the Basics panel, click Registration Server, select Hub/WWCorp, and click OK. Then enter the following information.
Field Value
First name Student
Last name ND01
Password lotusnotes
7 Click Password Options, then: On the Password Quality Scale, select Weak password, not very secure (6).
Select Set internet password. Select Synch internet password with Notes ID password. Click OK.
8 On the Mail panel, do the following: Select Create file in background. Click Mail Server, enter Hub/WWCorp, then click OK. For Mail file owner access, select Manager.
9 On the Address panel: Verify that the Internet Domain is wwcorp.com For Address format, select FI LastName.
10 On the ID Info panel, verify that the certifier ID is /WWCorp and that the user ID will be stored in the Domino Directory.
11 On the Groups panel, select the Students group in the left pane, then click Add.
(continued on next page...)
32 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 8: Register the student accounts...
Step Action
12 After completing all required fields, click to add the user to the queue.
13 Repeat Steps 5 through 11 for each of the following student accounts: Student ND02 Student ND03 Student ND04 Student ND05 Student ND06 Student ND07 Student ND08 Student ND09 Student ND10 Student ND11 Student ND12
14 To register all users in the queue, click Register All.
15 Click OK to acknowledge successful registration.
16 When finished, click Done to close the Register Person dialog box.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls 33
PreviewClassroom Setup
Classroom Setup Instructions...(continued)
Task 9: Modify security settings in Server document
Note: Skip this step if using the supplied files.
Follow these steps to modify the programming security fields in the Server document.
Step Action
1 From Domino Administrator, select the Configuration tab Server section All Server Documents view.
2 Select the instructor server document, and click Edit Server.
3 Select the Security tab.
4 On the Security tab, enter the groups LocalDomainAdmins, LocalDomainServers and Students (or */WWCorp) in each of the following fields:
Server Access: Create new databases & templates Create new replicas Create master templates
Programmability Restrictions: Run unrestricted methods and operations Sign agents to run on behalf of someone else Sign agents to run on behalf of the invoker of the agent Run restricted LotusScript/Java agents: Run Simple and Formula agents Sign script libraries to run on behalf of someone else
5 Click Save & Close.
34 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
A Exploring IBM LotusDomino 6 and Domino Designer 6Lesson 1 Introduction to IBM Lotus Domino 6
Lesson 2 Exploring Domino Designer 6
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Introduction to IBM Lotus Domino 6
Introduce the lesson
36 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
1 Introduction to IBM Lotus Domino 6
Objectives
After completing this lesson, you should be able to:
9 Describe Domino and its functions
9 Describe the structure and components of a Domino database.
9 Access data in a note.
Student Guide Page No. 18 37
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
What is IBM Lotus Domino 6?
Explain the evolution of data management
It sometimes helps students new to application development to go through the evolution of data management leading up to the Notes/Domino client/server functionality. The bullets below contain information to help you briefly explain the evolution of data management and computing to the students.
� Draw a diagram on the white board that starts with main frames, leads to PCs, which leads to LANs with simple file sharing, which leads to Domino.
� Draw a high level conceptual diagram showing that Domino does two things: runs tasks and holds databases.
� This leads into a discussion of replication, HTTP, Web access.
� Finally the discussion should lead to back end data sources.
The diagram/discussion should end with client/server computing and how Notes/ Domino fits there. The primary purpose of Notes/Domino in the client/server environment is collaboration. Another important point to bring out is that Domino is multi-platform.
At the end of this diagram process, the students should have an understanding of how Notes should be used, and a high level understanding of a couple of infrastructure topics. Keep the discussion at a very high level so that the students do not get overwhelmed with too much detail.
The idea is to give them a good foundation and a perspective for what is to follow.
This discussion should take 10 or 15 minutes maximum! Do not go into a discussion of Websphere as it will only confuse the students at this point.
Caution
38 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
What is IBM Lotus Domino 6?
IBM Lotus Domino 6 (Domino) applications let people share, collect, track, and organize information, using IBM Lotus Notes 6 (Notes) and other universallyavailable clients such as web browsers. The data itself may be contained in Notes databases or in legacy data systems.
Domino provides a wide range of collaborative services and a framework fordistributed business process applications and workflow. Domino and IBM WebSphere have built in integration points in the areas of directory, security,application development, and Java services.
Domino is a rapid application development (RAD) environment with a high returnon investment to its users.
Other features that Domino provides include:
� Integrated Web security
� Native HTML
� Integrated Javascript events
� Integration with the file system
� Java agents and servlets
� Distributed objects, such as CORBA/IIOP
� Integration with third party design tools
� Integration with Microsoft IIS
� Programmable object store
� Replication
Domino also integrates with back-end data sources such as DB2 and Oracle, and with transaction systems such as CICS.
Student Guide Page No. 19 39
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Examining a Domino Database
Explain the Domino database containment model
The notes in a database are also containers. They contain items. This is discussed later in the lesson.
40 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Examining a Domino Database
Domino database containment model
The foundation of the Notes/Domino design is the use of a single and simple data structure, called a note, to store all information. Notes are used to store data and design elements. Notes are described in more detail later in this lesson.
Domino databases are files that exist on the file system. Domino uses the path and file name to identify the database. Once the database is open, you access data by opening notes.
This relationship is described as a containment model. The file system contains databases, a database contains notes, and a note contains data.
The following diagram illustrates the Domino database containment model.
As the containment model shows, to access a database, you must first access the file system.
Student Guide Page No. 20 41
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Examining a Domino Database...(continued)
Describe what is stored in the storage facility
The storage facility contains notes. Notes are data containers. There are different types of notes to perform specific functions within the database. You will discuss notes in more depth in the following pages.
Describe the functionality of the index facility
The index facility is a subset of the database that builds and maintains sorted lists of data in the storage facility. These sorted lists are called views.
Note: You will discuss more on views later in this course.
42 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Examining a Domino database...(continued)
A Domino database contains two areas of functionality:
� Notes Storage Facility (NSF) maintains the data and design elements of the application.
� Notes Index Facility (NIF) builds and maintains lists for locating data in the application.
The following diagram illustrates the components of a Domino database.
Student Guide Page No. 21 43
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Creating a Domino Database
Introduce the three methods of creating a database.
Discuss the three methods noting the pros and cons of each.
The students will use all three methods during this course.
44 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Creating a Domino Database
You can create a Domino database in the following ways:
� Create a database from a template
� Create a new blank database
� Copy an existing database
During this course you will use all three methods.
Defining templates
A template is a database that contains the structure for a particular application, but does not contain any data. There are a number of standard templates that are included with Domino that let you easily set up a discussion database, a personal journal, or a collaborative team database.
You will learn more about working with templates later in this course.
Creating a new blank database
A blank database contains no design elements such as pages or forms. Blank databases have one default view.
Follow these steps to create a database from scratch:
Step Action
1 Choose FileÆ DatabaseÆ New. Result: The New Database dialog box appears.
2 Accept the default of Local to create the database on your local computer.
3 Enter a title for the database.
4 Enter a file name for the database.
5. Select -Blank- from the template list.
6 Click OK.
Student Guide Page No. 22 45
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Creating copies of the course databases
Guide students through the Guided Practice
Direct them to do the following:
� Use their initials in the file names and titles of their copies.
� Create their copies on their local systems.
� Bookmark their personal copies of the Student Practice and Instructor Demo database in the Notes client.
� Remove any bookmarks to the original databases.
Note: The students will copy the Instructor database. They will create their copy of the Practice database from the Practice_ND510.NTF template.
46 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Creating copies of the course database
During this course you will work in a Practice database for all Guided Practices and some Exercises. During the following Guided Practice you will:
� Create a personal copy of the Practice database from a template.
� Create a personal copy of the Instructor database by copying.
� Give your databases unique names.
� Create database bookmarks in the Notes client
Create a personal copy of the Instructor Demo database
Follow these steps to create a personal copy of the Instructor database.
Step Action
1 Open the Notes client.
2 Choose FileÆDatabaseÆOpen.
3 In the Server dialog box, select the course server.
4 In the Database dialog box, select Instructor Demo.
5 Click Open. Result: The Instructor Demo database opens in the Notes Client.
6 Choose FileÆDatabaseÆNew Copy.
7 In the Server dialog box, select Local.
8 In the Title dialog enter a title for the database that includes your initials. For example, if your initials are ABC, enter Instructor ABC.
9 In the File name dialog enter a unique file name for your copy of the database. For example, if your initials are ABC, enter InstructorABC.nsf
10 Click OK. Result: the new copy of the database is created and saved in the notes/data directory on your local system.
11 Next you will open your database and create a bookmark.
Choose FileÆDatabaseÆOpen.
12 Select your new file from the Databases list. Click OK.
13 Right-click on the window tab for your database. Choose Bookmark.
14 Click OK.
Student Guide Page No. 23 47
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Creating copies of the course databases...(continued)
Continue with the Guided Practice
(continued)
48 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Create copies of the course databases...(continued)
Create a personal copy of the Practice database
Follow these steps to create a personal copy of the Practice database:
Step Action
1 Open the Notes client.
2 Choose FileÆDatabaseÆNew.
3 In the Server dialog box, make sure Local is selected.
4 In the Title dialog enter a title for the database that includes your initials. For example, if your initials are ABC, enter Practice ABC.
In the File name dialog enter a unique file name for your copy of the database. For example, if your initials are ABC, enter PracticeABC.nsf
5 In the Specify Template for New Database section, select the classroom server in the Server dialog.
6 In the Template list, highlight Foundation Practice Template.
7 Click OK. Result: The new Practice database opens in the Notes client.
13 Right-click on the window tab for your database. Choose Bookmark.
14 Click OK.
Student Guide Page No. 24 49
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
How Domino Stores Information
Define item
Metadata describes how the data is formatted.
50 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
How Domino Stores Information
As stated earlier, the note is the data structure used to store all information in a Notes/Domino database.
Characteristics of notes
All notes in a database are essentially the same. They are peers to one another and do not share hierarchical or other relationships. Notes only differ in the data values they contain and how Domino uses them.
How a note stores data
A note stores data in items. Each item is identified by a name and contains a list of values. The values in a single item must be the same data type. Items also store information about the data. This metadata is available to the application and the Domino services.
Metadata is, literally, data about data.
Student Guide Page No. 25 51
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
How Domino Stores Information...(continued)
Describe the different types of notes
There are notes that you create and notes that Domino maintains automatically.
Note: Any student already familiar with the Notes client will know “data” as “documents.”
52 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
How Domino Stores Information...(continued)
Types of notes
A Domino database contains Header, ACL, and Design notes. It also contains Data notes once the users of the database creates them.
Some notes are created by users and developers and other notes are maintained by Domino to track and control information in the database.
Notes that developers create
The following table describes the types of notes that users and developers can create in a Domino database.
Type of Note Purpose
Data Stores data values used in the application. For example, a data note may contain customer profile information, such as the customer’s name, address, and phone number.
Design Stores data used to process or affect the presentation and functionality of the application. For example, a design note may contain instructions for how Domino displays information to a user.
Notes that Domino maintains
The following table describes other types of notes that Domino maintains.
Type of Note Purpose
ACL The ACL stores a list of names and options for controlling access permissions to the database.
Database header Domino stores information about the database in a database header note. The database header contains information such as the version of Domino used to create the database, the title of the database, the database ID, etc.
Student Guide Page No. 26 53
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Accessing Data in a Note
Open the Document Properties box
In the Instructor Demo database, open the Document Properties box using alternate methods (for example, the right-click menu).
54 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Accessing Data in a Note
Data is stored in a specific kind of note, referred to either as a data note or a document. Both terms are used interchangeably throughout this course. You can create and access documents in many ways.
The Document Properties box
The Notes client provides users with the ability to examine documents through a properties box. The Document Properties box reads the contents of a document and displays information to the user.
The following diagram shows the Document Properties box.
Open the Document Properties box
Follow these steps to open the Design Document Properties box.
Step Action
1 Open the database in the Notes client.
2 Select the document you wish to examine.
3 Choose FileÆDocument Properties (or right-click) to open the Document Properties box.
4 Use the tabs of the Properties box to view the structure of the data note.
Student Guide Page No. 27 55
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Accessing Data in a Note...(continued)
Examine data in a document
Use the document properties box to analyze the data contained in a document.
Show students how to locate the following information:
� Properties, such as the created date and last user to modify the document
� Item values and meta-data, including the data type and special flags (Summary and RichText)
� The document ID
Note: An overview of programming languages is contained in Appendix B.
56 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Accessing Data in a Note...(continued)
Examining a document through the Properties box
The properties box has several tabs that display different information about the document. The following table describes three of these tabs.
Tab Information Displayed
Document Info Data about the document that Domino maintains, for example: � When it was created
� When it was last modified
� Who last modified it
Fields List of the items in the document and the data each item contains. Selecting an item in the left pane displays its value and meta-data in the right pane. Meta-data includes the data type and special flags Domino uses when dealing with this data.
Document IDs The Unique ID of the document.
Other ways of accessing data
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
Student Guide Page No. 28 57
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Analyzing Documents Exercise
Introduce the exercise
Students should be in the All Documents view or they will not see the documents created by the agent.
Review the exercise
Students should have used the Document Properties box to answer the questions.
Now that the students have an overall view of the Domino database, you will introduce them to Domino Designer.
The last part of this lesson addresses using the Notes client and a Web browser to access a Domino application.
58 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Analyzing Documents Exercise
Documents
In this exercise, you will answer questions about the content of documents.
Tasks
Open the Customer view in your copy of the Instructor database. Answer the following questions:
� Who last updated the document?
� When was the document created?
� What is the data type of the CustomerID item?
Student Guide Page No. 29 59
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Using the Notes Client to Access A Domino Application
Use Notes to access a Domino application
Open the Instructor Demo application, Instructor_ND510.nsf, using the Notes client, and describe the Domino services being used as the database opens (including Authentication and Authorization).
When the Instructor Demo database opens, it displays two messages:
� A message welcoming you - indicating that you have been authenticated
� A message identifying your access level - indicating that you have been authorized to access this database.
Stop the message boxes from popping up for the rest of the class by commenting out the two MessageBox statements at the end of the code in the PostOpen event of the Database Script.
Instructor Task
60 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Using the Notes Client to Access A Domino Application
Domino applications are client-server applications. The client communicates with the application using a proprietary remote procedure call mechanism. The Notes Remote Procedure Call (NRPC) transmits the client request to the Domino application and returns the results.
Domino authenticates users when they access applications on the server. Other Domino services are called upon depending on the specifics of the application.
Accessing a Domino application with Notes
The following table describes the stages that occur when a user accesses a Domino application from a Notes client.
Stage Description
1 User makes a request to open, read, or save data in the application.
2 Domino authenticates the user making the request and provides authentication information about itself to the user. This occurs when the client first accesses the server.
3 Domino verifies the rights of the user making the request, every time a request is made.
4 Domino executes the request and responds to the client.
The following diagram illustrates the Notes client accessing a Domino application.
Student Guide Page No. 30 61
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Using the Notes Client to Access a Domino Application... (continued)
Describe working with local applications
The server is the entity that authenticates you.
62 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Using the Notes Client to Access a Domino Application... (continued)
Working with local applications
A local database allows users to work off-line (not connected to the network). Local databases can also be used to run personal applications that should not be available to multiple users.
The Notes client provides a subset of Domino services to execute common functionality locally and reduce the load on the server. The client does not support the same level of security checks and restrictions that the server does. However, there are database properties that the developer can employ to enforce a certain level of security on applications that reside locally.
Student Guide Page No. 31 63
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Using a Web Browser to Access Domino Applications
Explain how Domino supports Web clients
When explaining the diagram, note that HTML is passed between the Web browser and Domino just like any other Web server.
Use a Web browser to access a Domino application
Open the Instructor Demo application using a Web browser, and describe the Domino services involved in this action (including authentication, authorization, and HTTP translation.) Note that the way each client accesses a Domino application is very similar.
Caution
Note about step 2 in the table on the student guide page. Authentication does not always happen. Authentication is the process of verifying the identity of a user (or server). It depends on the server setup and the database ACL. If both server and database allow Anonymous access, no challenge is issued to the client and the user is not authenticated. The result is that the user is identified as Anonymous.
64 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 1 � Introduction to IBM Lotus Domino 6
Using a Web Browser to Access Domino Applications
Domino supports the HTTP protocol allowing Web browsers to access applications on a Domino server.
As with access using a Notes client, Domino authenticates users when they access applications on the server via a Web browser.
Accessing a Domino application with a Web browser
The following table describes how browsers interact with Domino applications.
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, Domino authenticates the user making the request and provides authentication information about itself to the user. If both server and database allow Anonymous access, no challenge is issued to the client and the user is not authenticated. The result is that the user is identified as Anonymous.
3 Domino verifies the rights of the user making the request.
4 Domino translates the HTTP request.
4 Domino executes the request.
The following diagram illustrates how a Web browser accesses a Domino application. In this example, data is also accessed from DB2.
Student Guide Page No. 32 65
PreviewLesson 2 � Exploring Domino Designer 6
Exploring Domino Designer 6
Introduce the lesson
Domino Designer is the development environment used to develop Domino applications.
66 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
2
PreviewLesson 2 � Exploring Domino Designer 6
2 Exploring Domino Designer 6
The IBM Lotus Domino Designer 6 (Designer) client is used to create IBM Lotus Domino applications. In this lesson, you will explore Designer.
Objectives
After completing this lesson, you will be able to:
9 Access the design of a database.
9 Access individual design elements within the database.
9 Create application bookmarks in Designer.
Student Guide Page No. 33 67
PreviewLesson 2 � Exploring Domino Designer 6
Accessing a Database Design
Designer is the tool developers use to create an application that the Domino server serves to various clients.
Open a Domino database in Designer
Using the Instructor demo database, demonstrate the concepts presented on the Student Guide page. Students will have an opportunity to open a database and explore it at the end of this lesson.
Explore the design environment
Have the students open Designer Help to the Exploring Lotus Domino Designer topic. Review the Designer diagram and the list of Designer elements.
To help students feel comfortable with these areas, briefly demonstrate how to do the following:
� Collapse and expand a database to show the bookmark icons.
� List different design elements in the Work pane by clicking them in the Design list.
� Go to different windows by clicking tabs and close windows by clicking the X in the window tabs.
68 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 2 � Exploring Domino Designer 6
Accessing a Database Design
Designer is the development environment used to build Domino applications. Designer contains the tools necessary to create powerful Domino applications. To access the design of a database, open that database in Designer.
Opening a Domino database in Designer
Follow these steps to open a database in Designer.
Step Action
1 Open Designer.
2 Choose FileÆDatabaseÆOpen from the menu.
3 In the Server: box, enter the location of the application (server name or local).
4 In the Database: box, select the database from the list or enter it in the Filename: box (directory and file name).
5 Click Open.
Exploring the design environment
When you open a database in Designer, the first level of the design environment opens. The following table describes several areas in this environment.
Area Description
Design pane Includes the Design list for the database. This is the list of design elements and the Design bookmark icons, which point to the most recent databases on which you have worked.
Work pane Lists everything in the current database for the selected design element.
Across the top of the Work pane are Design action but-tons. These buttons perform actions on the currently displayed elements (such as creating a new form).
Window tabs Each item that you are working on currently has its own tab that, when clicked, takes you to the window that tab represents.
Student Guide Page No. 34 69
PreviewLesson 2 � Exploring Domino Designer 6
Accessing Design Elements
The rest of this course focuses on how to create and use the various design elements. The table on the Student Guide page is meant as an introduction.
70 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 2 � Exploring Domino Designer 6
Accessing Design Elements
Designer includes structures called design elements that are the building blocks for applications. Customize these structures to create applications.
Application tasks and corresponding design elements
The following table summarizes tasks you might want an application to perform and the corresponding Domino design element(s) you could use to implement them.
Application Task/ Functionality
Design Elements
Display, gather, and organize information.
� Pages: Contain text, images, applets, and other objects. Users cannot enter information into pages.
� Forms: Contain fields where users can enter values. The values are stored as a document.
� Views: Index and display lists of documents contained in the application.
Automate tasks. Actions and agents: Can run scripts when a user does something.
Control navigation.
Hotspots, framesets, outlines, and image maps: When used in combination, allow users to move around the application quickly and easily.
Access control and programming
Design elements are one of four pieces of a Domino application. Two other pieces - the Access Control List and Logic - will also be discussed in this course.
To... Use...
Apply logic Programming languages, which enable you to:
� Calculate or modify information.
� Validate inputs before saving.
Restrict access to information in the database
The Access Control List (ACL) and other elements, which identify the users who can:
� Create, read, and modify data.
� Change the design of the application.
Student Guide Page No. 35 71
PreviewLesson 2 � Exploring Domino Designer 6
Accessing Design Elements... (continued)
Note that the Design pane remains static, thus continuing to allow you access to all design elements.
Add or modify a page or form
Working in the Instructor demo database, demonstrate how an individual design element is modified and/or created in the Work pane.
72 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 2 � Exploring Domino Designer 6
Accessing Design Elements... (continued)
Accessing design elements
When you click a design element in the Design list, all of the individual, database-specific elements of that type of element are listed in the Design pane and the Work pane. To open an individual design element, double-click the element in the Work pane. The element then opens into the Work pane, with the Programmer’s pane below it.
The following diagram shows these areas in Domino Designer.
Design list Work pane
Objects tab Reference tab Script areaProgrammer’s
pane
pane
Using the Work pane
The Work pane is used for creating and modifying forms, pages, views, and other elements in the Design list that are specific to your application or database. When you open or create an individual design element, Designer automatically displays that element in the Work pane.
Student Guide Page No. 36 73
PreviewLesson 2 � Exploring Domino Designer 6
Accessing Design Elements...(continued)
Show the Programmer’s pane
Show the students how to access Help
74 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 2 � Exploring Domino Designer 6
Accessing Design Elements...(continued)
Using the Programmer’s pane
Use the Programmer’s pane to add code in areas of the current design element in the Work pane. The following table describes the parts of the Programmer’s pane.
Part Function
Objects tab Lists all areas (objects and events) in the current design element where you can add code. Code is added in the Script area. When you click an item in the Objects tab, the Script area changes to show the code that describes the object. The Reference tab reflects the language(s) that you can use in the Script area.
Reference tab Lists fields and functions that can be used to script the object. Designers can paste from the list or from the context-sensitive help into the Script area.
Script area Used to write scripts for the element selected using the Objects tab.
Domino Designer References
The following table describes different ways of getting help in Domino Designer.
Resource Function How to Open
Domino Designer Help
Provides details on:
� Using Domino Designer
� Designing Domino applications
Choose HelpÆHelp Topics from the menu.
Student Guide Page No. 37 75
PreviewLesson 2 � Exploring Domino Designer 6
Managing the Designer Environment
Lead students through this Guided Practice
After the students complete the Guided Practice, open Designer Help and show them where to find further information about working with folders and bookmarks.
76 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 2 � Exploring Domino Designer 6
Managing the Designer Environment
The Designer environment provides tools to help developers manage the development of complex applications. These tools include the ability to create bookmarks on the Designer bookmark bar, and the ability to create folders to organize application bookmarks
Create a Folder and Bookmark for the Course Database in Designer
In this Guided Practice you will create a folder on the Designer Bookmark bar that contains a bookmark for the Practice database.
Step Action
1 Open Designer.
2 Click the folder icon in the Design pane. Result: The Create Folder dialog box opens.
3 Enter a name for the new folder. Call it Foundation.
4 In the Create Folder dialog box, select the -Folders- location.
5 Click OK. Result: The folder appears on the Bookmark bar. If you move the cursor over the folder, its name appears as pop-up text.
6 Now create a bookmark within the folder.
Choose FileÆDatabaseÆOpen.
7 Select the name of your Practice database.
8 Click Open. Result: The database is opened in Designer.
9 Drag the database icon to the Foundation folder. Result: A bookmark for the Foundation practice database is created in the Foundation folder.
Student Guide Page No. 38 77
PreviewLesson 2 � Exploring Domino Designer 6
The Course Files
Explain the course databases and their usage
� Explain the uses of the course Practice database.
� Explain the uses of the Instructor Demo database.
� Show the finished Policies database, Policies.nsf, so that the students see what they will create throughout the course.
78 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 2 � Exploring Domino Designer 6
The Course Files
The Databases
Throughout this course you will work in several databases. They are:
� Practice database. This database is used in Guided Practices and some exercises. You created a personal copy of this database from a template in Lesson 1.
� Occasionally you will access the Instructor demo database. You created a personal copy of this database in Lesson 1.
� Policies database. You will create this database during exercises throughout the course.
The Policies database that you will design and develop will contain corporate polices and procedures for Worldwide Corporation. It will also contain a discussion forum so that employees can ask questions about policies or procedures.
The Scenario
Worldwide is an international pottery manufacturer. The company sells ceramics worldwide. Products include tiles, china, and various kinds of pottery. The corporate office houses manufacturing, research and development, product management, quality control, human resources, and system administration. There are several smaller sales offices and resellers throughout each region, and some sales representatives who work from their homes.
Student Guide Page No. 39 79
PreviewLesson 2 � Exploring Domino Designer 6
80 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
B Working with Design Elements Lesson 3 Working with Forms
Lesson 4 Working with Views
Lesson 5 Working with Pages
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewLesson 3 � Working with Forms
Working with Forms
Introduce the lesson
Forms contain fields to store information in documents and to display information to users. In this lesson, we will create and modify a form.
Note: The next lesson, Working with Views, examines how to build views to organize documents for users.
82 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
3
PreviewLesson 3 � Working with Forms
3 Working with Forms
Forms display and collect information. A form provides a structure for creating and displaying documents.
Objectives
After completing this lesson you should be able to:
9 Define a form.
9 Design a form.
9 Create a form.
9 Add text and formatting features to forms.
9 Preview a form in Notes and on the Web
9 Create fields to store data.
9 Describe the different types of fields.
9 Set a default value for a field.
9 Use Hide/When options to determine when to display data
Student Guide Page No. 42 83
PreviewLesson 3 � Working with Forms
Defining Forms
Examine the parts of a form
� Open the Instructor Demo database in Designer.
� Open the Demo form.
� Point out the various elements that are included on this form.
84 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Defining Forms
A form is a design element through which data is entered and displayed. Forms contain application logic, and can act on data. The data collected via a form is stored in a data note, also described as a document.
When a user adds information to a database through a form and saves it, the information is saved as a separate document from the form. When a user opens a document, the document uses the form as a template to provide the structure for displaying the data.
Forms consist of the following:
� Fields used to collect or display data.
� Static elements, such as text, graphics, and tables used to control appearance and user interface.
� Programming to act on data.
The following graphic represents the form design element.
Student Guide Page No. 43 85
PreviewLesson 3 � Working with Forms
Defining Forms...(continued)
Review the different types of notes
This is a brief reminder of the types of notes.
86 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Defining Forms...(continued)
Database notes
A form is a design note stored inside a Domino database. The data it contains is the description of the form. Domino databases contain four different types of notes.
The following table briefly describes the four note types stored in a database and their function.
Note Type Function
Header Contains information about the database itself, such as its name, size, creation date. Each database has a single header note.
ACL Note Stores the Access Control List, a list of names and permissions associated with the database.
Design Note Each design element, such as a form, view or page is stored in the database as a design note. The form design note acts as a template used to create new documents or display information.
Data Note A data note holds the information entered using a form, as well as system data used by Domino for management purposes.
Student Guide Page No. 44 87
PreviewLesson 3 � Working with Forms
Defining Forms...(continued)
Differentiate between elements and design elements
In this course, design elements refers to items found in the Design List. Element refers to items like tables, text, fields, graphics, etc, added to a Design element.
Process of creating a form
Discuss the three phases of developing a form as listed on the Student Guide
88 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Defining Forms ...(continued)
Elements used in forms
The following table describes the elements that might be included on a form.
Element Function
Text and graphics Display information or pictures on all documents using the form.
Fields � Display data from documents. � Save data to a document. � Compute a value.
Properties Control attributes of the form. For example, a background color is a form property.
Other elements, such as: � Subforms � Shared fields � Buttons and actions
Offer additional tools to the designer, often enhancing interactivity or efficiency of the form.
Process of creating a form
There are three phases to creating a form:
� Design the appearance
� Create the form
� Test the form
Student Guide Page No. 45 89
PreviewLesson 3 � Working with Forms
Designing a Form
Discuss planning with design elements
It might be helpful here to briefly discuss the aspects and significance of the following when planning a Domino application:
� Design standards
� Method and importance of gathering system requirements
� Identifying project stakeholders
� Collaboration with the Domino system administrator
Most of these concepts are not unique to a Domino application developer. However, many students come to class without any experience in developing applications of any sort. Don’t go too deep into these topics.
Designing a form
To open a discussion on forms, ask the students what they would use forms for. Use the questions on the Student Guide page as a starting point.
Note: Don’t worry about the programming necessary to accomplish some of these tasks. Right now, emphasize that you are brainstorming and working in a general sense and will focus on the specifics as the course progresses.
90 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
7
PreviewLesson 3 � Working with Forms
Designing a Form
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?
Checklist: Designing a form
Complete these tasks to design and create a form.
Task Procedure
� Decide the purpose of the form.
� Determine the information the form will collect.
� Determine required elements for the form.
� Create the form.
� Add the required elements to the form.
� Save the form.
� Test the form in various clients.
Student Guide Page No. 46 91
PreviewLesson 3 � Working with Forms
Creating a Form
Create a form
Open the Instructor Demo database in Domino Designer to demonstrate creating a form.
� Create a form.
� Add a line of text.
Don’t worry about formatting the text which appears later in this lesson.
92 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating a Form
Once you have decided upon your form’s design, you can create it.
Creating a form
Follow these steps to create a form.
Step Action
1 Open the database in Designer.
2 In the Design pane, click Forms. Result: In the Work pane, the list of existing forms appears. The New Form button appears on the button bar.
3 In the Work pane, click New Form.
4 Choose Design Form ÆProperties
5 Enter a name in the Name field.
6 Close the properties box.
7 Add elements to the form.
8 Save the form.
Student Guide Page No. 47 93
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
Introduce properties boxes
Introduce properties boxes to students. Properties boxes are modal anD do not need to be closed after setting an element’s properties.
Explain that properties boxes are context sensitive--i.e. they are different depending upon where the cursor is when launched.
Demonstrate various property boxes
� Open the Demo form
� Open the properties box for the form
� Select a different element from the drop down list, such as text or database.
Each property box looks and behaves the same way. The difference from one element to another is the actual properties that can be set.
94 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
The form properties box
To examine information about a form, use the form Properties box. The properties of a form, as well as any other element, are modified through the Properties box.
The process to change the properties of an element is as follows:
� Select the element.
� Open its properties box.
� Specify the appropriate properties.
� Close or collapse the properties box.
Properties boxes do not need to be closed after each modification. They are “live”and change to reflect the latest element selected. Changes are applied immediately.
The following graphic shows the Form properties box.
Element Name
Tabbed Panes
Individual Properties
Expand/ Collapse Icon
Close Icon
Context Sensitive Help Icon
Use the properties box to specify attributes of a form such as:
� Form name
� Background color
� Header and footer text
Student Guide Page No. 48 95
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
Form names
Point out the form name guidelines listed in the Student Guide. Give examples from your own experience of good and bad form names.
Aliases are covered in the next topic.
For an example of a cascading menu topic:
� Choose Create ÆDocument in Domino Designer. � A list of existing forms appears to the right.
� This is a cascading menu.
Note: This is also a good opportunity to direct students to Designer Help for Naming forms to get more complete answers.
96 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
Naming the form
Form names within the same database must be unique.
Form names may include:
� Characters
� Spaces
� Numbers
� Punctuation
Form names are also case-sensitive.
Although the name itself is limited to 64 bytes, the size limit increases to 256 characters if there is a name alias or cascading menu option.
Student Guide Page No. 49 97
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
Introduce form aliases
Introduce the concept of aliases to the students. Explain that they can be used not just for forms but other design elements as well, such as views. Make sure that you emphasize why aliases are useful, especially when students begin to create formulas.
Create a form alias
Demonstrate how to create a form alias.
� Use the form you created previously.
� Choose DesignÆ Form Properties � In the name box give the form an alias.
� Save the form
Indicate to students that there is more than one way to open a properties box and that for continuity, the procedures and guided practices will use the menu bar option, although students are free to use whatever method they prefer, such as the right mouse click options.
98 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
Aliases
An alias is simply another name for a form or other design element. Aliases are a short way to refer to the form. If an alias exists, it is used to:
� Refer to the form programmatically.
� Consistently refer to the form, even if the name of the form changes.
Aliases are an internal reference to the form, or element they are associated with.
Creating a form alias
Follow these steps to add an alias to a form.
Step Action
1 Open the form.
2 Choose one of the following methods to open the Form properties box:
� Design Æ Form Properties � Right Click on the form. Choose Form properties.
3 In the Name box, type a | (pipe*) and your alias name after the existing form name. For example: formName | fn
* Press SHIFT + \ for the pipe symbol.
4 Close the Form properties box.
5 Save your form.
Student Guide Page No. 50 99
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
Introduce the Guided Practice
Introduce the Guided Practice as outlined in the student guide. The students create a simple form with an alias.
Allow approximately 5 minutes.
100 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating a Form...(continued)
Create a form
Follow these steps to create a simple form with an alias.
Step Action Result
1 Open the Practice database.
2 Click Forms in the Design list. A list of existing forms appears in the Work pane.
3 Click New Form. A new blank form is opened.
4 Choose Design ÆForm Properties.
The Form Properties box is opened.
5 Type the following name and alias into the Name box. Employee Information | ei
6 Close the Form properties box.
7 Save the form. Your new form and its alias appears in the form list.
Student Guide Page No. 51 101
PreviewLesson 3 � Working with Forms
Adding Text to a Form
Adding text to the form
Demonstrate adding text to a form and formatting it.
� Open the form you created previously.
� Type some text.
� Highlight the text.
� Select Text ÆText Properties.
� Change the font style and size.
� Close the properties box.
102 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Adding Text to a Form
Forms can contain the following kinds of text:
� Static text, for example, the form title, field labels, or explanatory text.
� Dynamic text, for example, text that is computed.
Formatting text
Use the text properties box to modify text on your form. Using the text propertiesbox you control:
� Font
� Paragraph Alignment
� Paragraph Margins
� Paragraph Border
� When to display or hide a paragraph
� Paragraph Styles
The following graphic shows the text properties box.
Student Guide Page No. 52 103
PreviewLesson 3 � Working with Forms
Adding Text to a Form...(continued)
Introduce the Guided Practice
Introduce adding and formatting text as outlined in the Student Guide. In this practice, students modify the form created in the previous Guided Practice.
Allow 5 minutes for this Guided Practice.
104 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Adding Text to a Form...(continued)
Adding and formatting text
Follow these steps to add formatted text to your form.
Step Action Result
1 Open the Employee Information form in the Practice database.
2 Type the following text: Employee Information Form
The text appears in the top left corner of your form.
3 Highlight the text you just typed and open the Text properties box by choosing Text Æ Text Properties.
The text properties box opens to the Font tab.
4 On the Font tab, choose Arial 24 points.
The text changes to Arial font and 24 points large.
5 Click on the Paragraph Alignment tab and choose the centered text option.
The text is centered across the top of the page.
6 Click on the Paragraph Border tab and choose the Double style. Select Drop Shadow.
A border box appears around your text, running the length of the form.
7 Close the Text properties box.
8 Save your form.
Student Guide Page No. 53 105
PreviewLesson 3 � Working with Forms
Previewing Your Work
Demonstrate previewing your work
Demonstrate previewing your work in both the Notes client and a web browser. Be sure to highlight any differences between the form’s appearance in the two.
106 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Previewing Your Work
To determine how your work looks and behaves in the target client, preview your work in the supported Web browsers as well as the Notes client.
For each supported browser Designer finds installed on your PC, it adds an icon to the Preview toolbar. Clicking a browser icon previews the current design element in the associated browser.
The following graphic shows the Preview toolbar.
Previewing your work
Follow these steps to preview your work.
Step Action
1 In Designer, open the design element you wish to preview.
2 Either choose the appropriate menu commands or click one of the Preview buttons. The menu commands are as follows:
� Design Æ Preview in Notes
� Design Æ Preview in Web Browser.
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 Designer.
Student Guide Page No. 54 107
PreviewLesson 3 � Working with Forms
Adding Tables to a Form
Explain where tables are created
Explain the information on the student page.
Introduce table types
Only basic tables are used in this lesson.
Note - The table type can be modified using the Special table row display option in the Table Rows tab of the Table properties.
108 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Adding Tables to a Form
A table is an element you can use to organize content into rows and columns. Use tables to organize, summarize, and align elements such as text, fields, and graphics.
Tables can be created in:
� Pages
� Forms
� Subforms
� Table cells
Types of tables
Domino Designer provides four types of tables. The following table describes these types.
Display Description
Basic Displays data organized into rows and columns. Looks like a grid or spreadsheet.
Tabbed Displays each row of data as a separate tab. Users view information displayed in the rows by selecting a tab.
Animated Displays one row of the table at a time based on a specified time interval. Animated tables are not supported on the Web and are not designed for data entry on forms.
Programmed Displays a different row of the table based on an action or field
Student Guide Page No. 55 109
PreviewLesson 3 � Working with Forms
Adding Tables to a Form...(continued)
Create a table
In the Instructor database, open the form you created previously in this lesson. Add a table with 2 columns and 2 rows. Point out the different width and table type options.
110 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
7
PreviewLesson 3 � Working with Forms
Adding Tables to a Form...(continued)
Table width options
When a table is created, there are three width options available: Fit with margins, Fit to window, and Fixed width.
The following table lists these options and their results.
Table width option Result
Fit with margin The table fills a given body size, from margin to margin. This is useful when nesting tables within one another.
Fit to window The width of the table will fill the margins regardless of frame size.
Fixed width A measured column width is set for the table, regardless of the size of the window.
Creating a table
Follow these steps to create a table.
Step Action
Open a form in Designer.
Choose CreateÆTable from the menu.
Specify the number of rows and columns for the table.
Specify the table width.
Select a table type by choosing one of the options.
Click OK.
Save and preview the form.
Student Guide Page No. 56 111
PreviewLesson 3 � Working with Forms
Creating Fields
Introduce fields
Now that students have seen how to create a form and add text and tables, talk about fields.
Open the Demo form in Designer to show several different fields. Preview the form in the Notes client to demonstrate how the fields:
� Collect data
� Display data
� Calculate
Have students create a document or two using the Demo form in their Practice databases.
Describe the process of creating fields
Refer to the checklist on the Student Guide page.
112 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
7
8
PreviewLesson 3 � Working with Forms
Creating Fields
A field is a part of a form that collects, calculates, or displays data. Each field stores a single type of information. The type of information a field accepts must be defined.
Fields are used to:
� Enter data in documents.
� Modify the content of documents.
� View data in documents.
� Calculate data through formulas.
Checklist: Creating form fields
Complete these tasks to create form fields.
Task Procedure
� Add the field to the form.
� Name the field.
� Specify data type.
� Specify how the field is populated.
� Set additional field properties, and/or
� Optionally program field contents.
� Save the form.
� Test the form in various clients.
Student Guide Page No. 57 113
PreviewLesson 3 � Working with Forms
Creating Fields...(continued)
Demonstrate adding a field to a form
� Add a field to a form.
� Show students the default settings on the Field Info tab of the Field properties box.
Discuss these properties in the next couple of pages.
114 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating Fields...(continued)
Specifying field characteristics
When 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.
Adding a field to a form
Follow these steps to add a field to a form.
Step Action
1 Place the cursor at the desired location on the form.
2 Choose CreateÆField from the menu. Alternatively, right-click the form and choose Create Field.* Result: Domino adds a field to the form and opens the field’s properties box.
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.
*Note: Like many applications, there can be several options for performing a task. In this course we use the menu bar option for consistency. However, feel free to choose whichever method you are most comfortable with.
Student Guide Page No. 58 115
PreviewLesson 3 � Working with Forms
Creating Fields...(continued)
Describe rules and guidelines for naming fields
Describe the different types of data fields
Open the Demo form in the Instructor database to show different field types and their functions.
116 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating Fields...(continued)
Naming fields
Each field in a form must have a unique name in that form. Use the following rules and guidelines when naming fields.
Field names cannot:
� Exceed 32 characters.
� Begin with a number.
� Use the @ symbol.
� Contain spaces.
Caution
Field names can begin with dollar signs ($). However, this typically indicates a reserved field name. These types of fields add functionality that you would otherwise have to program yourself. If you try to use a reserved name in a way that is different from its intended use or redefine the field, Designer displays an error message.
Specifying the type of data for a field
The field’s data type determines two things: (1) what type of information the field can contain, and (2) how the field is populated.
Fields can contain some of the following types of data:
� Text
� Numbers
� Date and Time
� Formulas
� Rich Text
A more complete list may be found in Designer Help.
Student Guide Page No. 59 117
PreviewLesson 3 � Working with Forms
Creating Fields...(continued)
Specify how the field value is populated
Use the following examples when discussing the information in the table on the student page.
� Editable: Name, address, etc.
� Computed: Date created, who last edited the document, etc.
� Computed for display: A calculation based on other fields in the document.
� Computed when composed: Who created the document, etc.
Spend some time discussing design considerations for fields and their layout
118 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Creating Fields...(continued)
Specifying how the field is populated
When you indicate the type of data a field contains, you also indicate how the field gets its value.
The following table lists the field value options and their purpose.
How the field value is created
Value is...
Editable Entered by the user. There can be a default 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. Domino does not store the result with the document. It calculates the value each time users refresh the document.
Computed when composed
Created when the document is created. Note: If the field is added to a form, after documents have been created, the value is calculated the next time one of these documents is opened.
Design considerations when adding fields
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, field labels).
� How the data should appear to the reader.
� How to identify the field for yourself when designing the application (field name).
Domino processes forms from the top-left to the bottom-right. Keep this in mind if you create fields whose calculations are dependent upon other fields on the form.
Student Guide Page No. 60 119
PreviewLesson 3 � Working with Forms
Working with Text Data
Explain the difference between a text field and a rich text field
Show text and rich text fields as you talk about them. The Demo form contains these types of fields.
Show Native OS
Use the Demo form to demonstrate the Native OS property. Use the Native OS option with text fields.
120 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Text Data
Designer allows you to specify the type of text data a field will store. The types of text data include:
� Text
� Rich text
� Lists
� Names
Using text fields
A text field is editable by default. Users can enter and view alphanumeric data inthis type of field. One example of a text field is a field used to collect or display acustomer name.
Text fields have the following characteristics:
� The display format is defined by the field on the form.
� Contain no fixed field length.
� Can display in a view.
Using rich text fields
A rich text field stores complex data. An example of a rich text field is the Body field used in the mail memo.
Rich text fields have the following characteristics:
� Stores many types of data, including graphics.
� Stores formatting with the data.
� Cannot display in a view.
Using Native OS Style
Native OS is a style selected on the Field Info tab in the Field properties box. The Native OS style has a user friendly interface for text fields. For example, Editable text fields appear on the document as a fixed-sized outlined box instead of as a blank space marked off by brackets.
Student Guide Page No. 61 121
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Introduce the Guided Practice
Allow the students 10 minutes for this Guided Practice.
122 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Adding text fields to a form
Follow these steps to add first and last name fields, along with text labels, to the Employee Information form.
Step Action Result
1 Open the Employee Information form in Designer.
The form opens in the Work pane
2 Place the cursor below the formatted text.
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.
A table with one row and four columns is inserted.
4 Place the cursor in the first cell of the table. Enter the following text: First Name:
The text appears in the table cell.
5 Place the cursor in the second cell.
Choose CreateÆField to create a field with the following characteristics: Name: FirstName Type: Text/ Editable
The FirstName field is created.
6 Place the cursor in the third cell of the table. Enter the following text: Last Name:
The text appears in the table cell.
7 Place the cursor in the fourth cell. Choose CreateÆField to create a field with the following characteristics: Name: LastName Type: Text/ Editable
The LastName field is created.
8 Save the form.
7 Preview the form in Notes.
Student Guide Page No. 62 123
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Show examples of list fields
� Open the Demo form to show an example of a Listbox field (Department).
� Modify this field to demonstrate how the other list field options would look.
� Preview your changes in the Notes client and a web browser.
Note: Dialog lists are rendered in web browsers as combo boxes.
Note: Open the Creating fields to display a list of choices document in Designer Help for more detailed information on these field types.
124 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Using list fields
List fields present users with a list of pre-defined choices. Some types of list fields allow the selection of a single choice, multiple choices, or choices not in the list.
The following table describes the list types available and when to use them.
Use this type of field If you want the user to select
Dialog list One or more choices from a pop-up dialog box or 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 add a choice not in the list.
Creating a list of choices
Follow these steps to create a field with a list of choices.
Step Action
1 Place the cursor at the desired location on the form.
2 Choose Create Æ Field from the menu. Type a name for the field and choose 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.
Student Guide Page No. 63 125
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Demonstrate how to set a default value
This is the students first introduction to formulas.
� Explain that formulas are covered in great length later in the course.
� Briefly explain the UI of the Programmer’s pane. This is also covered later.
� In the Instructor database use the Demo form to set a default value in the Department listbox. For example, change the default to Sales.
126 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Setting the default value for a list field
Providing a default value for a list field ensures that the field gets filled in and often removes the need for users to enter data.
Follow these steps to set a default value for a list field.
Step Action
1 Open the form in the Designer client.
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 top of the
object list. � Default value should be highlighted. If not, click once on Default Value to
select this event.
4 In the Script area, enter the default value surrounded by quotes. Click the checkmark. Result: A value surrounded by quotes displays in the Script area. Caution: This value must exactly match the field name’s spelling and case.
5 Save the form and preview the design changes.
The following graphic shows the Programmer’s pane with a field entered as a default value.
Student Guide Page No. 64 127
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Introduce the Guided Practice
Allow 10 minutes for this Guided Practice.
128 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Create and set a default value for a list field
In this Guided Practice, you will create several list fields and set default values for them. Follow these steps to complete the Guided Practice.
Step Action Result
1 Open the Employee Information form in Designer.
The form appears in the Work pane.
2 Add the following field label below the table: Employment Status
The text is inserted.
3 Add a field next to the text. A new field is inserted.
4 Open the Field properties box. Add the following characteristics on the Field Info tab: Name: EmploymentStatus Type: Listbox, Editable
The name and field types are set.
5 On the Control tab, enter the following choices: � Full time � Part time � Contractor
The list choices are set.
6 From the Objects tab in the Programmer’s pane, select the Default Value object.
Just above the script area, the text “EmploymentStatus (Field): Default Value” displays.
7 In the Script area, enter the default value “Full time” and select the checkbox.
The value is entered in the Script area.
8 Repeat steps 2 through 5 and add another list field with the following characteristics: Name: Department Type: Listbox, Editable Choices: Administration, R&D, Manufacturing
9 Save and test the form.
Student Guide Page No. 65 129
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Describe Name fields
In the Instructor Demo database, open the Demo form to show an example of a Names field.
Readers and Authors fields will be covered in Module F: Working with Security.
130 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Text Data...(continued)
Using Name fields
Domino differentiates text that represents names by having a special category of fields to store names. Because Domino uses system-specific ways to identify users and servers, consider using a Name field when dealing with names.
The following table describes the three types of fields that deal with names.
Field Type Used to...
Names Insert or display the name of a user or server.
Readers May restrict read access to the document. A value in a Readers field will restrict read access to those names specified in that field or in any other Readers or Authors fields in the document.
Authors Grants read access to the document and grants edit authority to any name that is also specified as an Author in the Access Control List (ACL).
An Authors field is a type of field that works in conjunction with the Author access level in the database's Access Control List (ACL). Authors fields do not override the setting in the ACL. They offer developers more control over which users can edit data in the application.
Entries in a Readers field cannot give a user more access than is specified in the ACL; they can only further restrict access.
Student Guide Page No. 66 131
PreviewLesson 3 � Working with Forms
Working with Numeric Data
Show number fields
In the Demo form, demonstrate the following:
� Set different number formatting options for the Salary field.
Point out that a blank value defaults to null which is text, not a number
Note: Have the students add a Salary field to the Employee Information form.
132 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Numeric Data
Create a number field when the data that users will enter is numeric. Domino can use data in a number field to perform mathematical calculations. 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 computed when composed.
Setting the style of a number field
Follow these steps to set the style of a number field.
Step Action
1 Create the field.
2 In the Basics tab of the field’s Properties box, select Number as its type.
3 Click the Control tab to set the style.
Using a default value for numeric fields
If a numeric field is saved with a blank, an error will occur if you try to compute a value based on it. A blank value is represented by two
Caution quotations, "", and evaluates to a text string. To ensure that numeric fields maintain the proper data type, set an appropriate default value in the Programmer’s pane.
Student Guide Page No. 67 133
PreviewLesson 3 � Working with Forms
Working with Date/Time Data
Add date/time fields to a form
Open the Demo form and add date/time fields. Format them in different styles.
Show Calendar/Time Control
Use the Demo form to demonstrate the Calendar/Time Control property. Use the Calendar/Time Control option with date and time fields.
Note:
� For the calendar/time control to work the field properties must be set to display only the date (for a calendar control) or only the time (for a time control). If both are selected, the field is blank and has no control.
� Calendar/time controls do not display in web browsers.
Note: Have the students add a date field called DateCreated to the Employee Information form.
134 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Working with Date/Time Data
When the data users enter or manipulate references dates or times, use a date/ time field. Date/time fields represent time using a set of numbers and punctuation. Domino stores time in seconds.
There are many formatting options available for displaying dates and times. Although the default time format is: MM/DD/YY HH:MM:SS, the operating system’s regional settings could affect how dates are displayed.
Date/time fields can be editable, computed, computed for display, or computed when composed.
Creating date/time fields
Follow these steps to set the style of a date/time field.
Step Action
1 Create the field.
2 In the Basics tab of the Field properties box, select Date/Time as its type.
3 Click the Control tab to format the field.
Using Calendar/Time Control
Calendar/Time Control is a style selected on the Field Info tab in the field properties box. The Calendar/Time Control style has a user friendly interface for date/time fields available only to the Notes client. Editable Date/Time fields display as a graphical date/time control.
Student Guide Page No. 68 135
PreviewLesson 3 � Working with Forms
Using Hide/When Options
Define the Hide/When property
� Show students the Hide/When tab on the Field properties box.
� Explain the options available.
� Define a paragraph, i.e. between carriage returns.
� Point out that when a field is hidden, the entire paragraph on the form that contains the field is hidden as well.
� Mention that tables can be used to hide information within a line of text since each cell is treated as an individual paragraph.
136 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Using Hide/When Options
Hide/When is a property that controls when an element is visible to users or a specific set of users. The Hide/When option hides the entire row where the selected field, text or graphic is located. However, if the item is inside a table cell, only the contents of the cell are hidden.
Some elements that contain Hide/When functionality are:
� Text
� Fields
� Graphics
The following table details the options available for hiding elements.
Option Description
Previewed for reading The hidden information is not visible when users read documents in the document Preview pane.
Previewed for editing The hidden information is not visible when users work on documents in Edit mode in the document Preview pane.
Opened for reading The hidden information is not visible when users open documents in Read mode. A field that cannot be read cannot be printed or copied to the clipboard.
Opened for editing The hidden information is not visible when users work on documents in Edit mode.
Printed The hidden information is not visible on printed documents.
Copied to the Clipboard The hidden information is not visible when information is copied to and pasted from the Clipboard.
Embedded The hidden element is not visible when the document is an embedded document.
Hide paragraph if formula is true
A formula determines the circumstances in which information is hidden.
It is important to note that the Hide/When option is not a security feature.
Student Guide Page No. 69 137
PreviewLesson 3 � Working with Forms
Using Hide/When Options...(continued)
Describe conditions for using Hide/When options
Use the questions from the student guide as a starting point. Ask students for their business needs for using the Hide/When feature. Give some examples from your own experience.
138 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Using Hide/When Options...(continued)
Conditions for using Hide/When options
When determining whether or not to hide a field, ask the following questions:
� Is it appropriate for all users to see this data?
� Do users need to see the data at all times?
For example, World Wide Corporation has a standard form filled with information about their employees. When a manager opens an employee’s profile, she doesn’t need to see all the company departments, just the one to which the employee belongs. On the other hand, when new employees are added, or an existing employee’s information is updated, it would be helpful to see all the departments.
The following table outlines conditions to hide information.
If Users Are... Then...
Reading a document Hide information that is useful only when users create or edit documents.
Editing, creating, or printing documents
Hide information that is useful when users read documents.
In the previous example, the Department field is a list field. In order to view the list field while editing and the resulting data when reading, create the following two fields:
� A list field containing all the World Wide Corporation departments.
� A computed for display field to display the resulting value
Student Guide Page No. 70 139
PreviewLesson 3 � Working with Forms
Using Hide/When Options...(continued)
Show a list field in Read mode
Use the Demo form to demonstrate Hide/When options.
� Modify the Department field to display only when in edit mode.
� Show how this field appears in Create/Edit mode versus Read mode.
� Use Hide/When properties and create a computed for display field so that only the selected value of a list field (and not the list of choices) displays in Read mode.
Be sure that students understand how to switch between Read mode and Edit mode.
140 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Using Hide/When Options...(continued)
Displaying the selected value of a list field in Read mode
Follow these steps to set Hide/When options for a list field.
Step Action
1 Create an editable list field.
2 Set the properties on the Hide/When tab so that the list field 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 is hidden when the document is: � Previewed for editing. � Opened for editing.
5 In the Programmer’s pane, select the Value object for the computed field from the Objects tab.
6 In the Script area, enter the name of the list field.
7 Save the form.
8 Test the form.
Student Guide Page No. 71 141
PreviewLesson 3 � Working with Forms
Using Hide/When Options...(continued)
Introduce the Guided Practice
Demonstrate for students what the finished product should look like.
Allow 10 minutes for this Guided Practice.
142 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Using Hide/When Options...(continued)
Set Hide/When properties
In this Guided Practice you will create a field named DEmploymentStatus (the “D” in front of the field name indicates that the field is for display only) and set the appropriate Hide/When properties so that the EmploymentStatus list field displays when the document is new or in Edit mode, and the DEmploymentStatus field is displayed when the document is in Read mode.
Follow these steps to complete the Guided Practice.
Step Action Result
1 Add label text and a field on the line below the EmploymentStatus field that has the following characteristics: � Label text: Employment Status � Field Name: DEmploymentStatus � Field Type: Text, Computed for
display
The new field is created.
2 To set the value of DEmploymentStatus: � Highlight the field. � In the Script area of the Programmer’s
pane, enter EmploymentStatus.
The default value for the new field is set to the value of the EmploymentStatus field.
3 To set Hide/When properties for the new field: � Highlight the field. � In the Field properties, click the Hide/
When tab. � Select Previewed for Editing and
Opened for Editing.
The field will only display when the form is in Read mode. It will not display when the user is editing the document.
4 To set the Hide/When properties for the EmploymentStatus field: � Highlight the field. � Open the Field properties box. � Click the Hide/When tab. � Choose Previewed for Reading and
Opened for Reading.
The field will only display when the form is in Edit mode. It will not display when the user is reading the document.
5 Save and test the design changes. Create 4 or 5 documents using this form.
The EmploymentStatus field displays in Edit mode. The DEmploymentStatus field displays in Read mode.
Student Guide Page No. 72 143
PreviewLesson 3 � Working with Forms
Exercise: Create a database, and a form that contains a table and fields
Present the review questions
Before introducing the exercise, go over the following review questions:
� What is a form and what can it consist of?
� What should you consider when designing a form?
� What are the three minimum field characteristics you must specify?
� Is the Hide/When option a secure one? Under what conditions do you use this option?
Introduce the exercise
Briefly refer back to the simple class scenario before starting the exercise. Also, the procedure for creating a blank database is included in Lesson 1.
� Preview the Policy form in the Policies and Procedures database (Policies.nsf) in the Notes client so that students have an idea what they are working towards.
� Indicate that students are free to experiment with the field types they feel are most appropriate, for example, some might create the Category field as a listbox and others might use the radio button.
� Display the example exercise screen shot in the Practice database.
� Allow students 20 minutes for this exercise
144 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 3 � Working with Forms
Exercise: Create a database, and a form that contains a table and fields
Worldwide Corporation is in the process of creating organizational policies. In this exercise you will create a database and the form that will be used to enter the company’s policies and procedures.
Tasks
� Create a new blank database. Name it Policies.NSF.
� Create a new form in the new database. Name it Policy.
� Title the form Policies and Procedures.
� Format the title.
� Use a table to organize the following fields and field labels.
� Add the following field labels and field names to collect and/or display the following information:
� Policy Number: PolicyNo � Policy Title: PolicyTitle � Effective Date of the policy: EffectiveDate � Policy Description: Description � Policy Category: Category
The categories are Office Guidelines, Benefits, Holidays and Grievance Procedures
� The category should display when the document is in the read mode, while all the categories should be visible when the document is in edit mode
� Test the form.
Create several documents from the new form to see if the correct information is gathered and displayed. Close the document and reopen it to test the Category field functionality.
Note: The database will contain a default view. All of the documents you create will appear in this view. You will create a customized view in the next lesson.
Student Guide Page No. 73 145
PreviewLesson 4 � Working With Views
Working With Views
Introduce the lesson
Views are design elements that organize documents so users can find the information they need. This lesson describes how to design a view.
146 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
4
PreviewLesson 4 � Working With Views
4 Working With Views
Domino application developers use views to organize documents according to the needs of the users of the application. In this lesson, you will learn the basics of view architecture and working with views.
Objectives
After completing this lesson, you should be able to:
9 Design a view
9 Create a view
9 Specify documents for a view
9 Create a column
9 Specify contents for a column
9 Organize contents of a view
9 Format a view
9 Set view column totals
Student Guide Page No. 74 147
PreviewLesson 4 � Working With Views
Introducing Views
Explain these important points about views
� Each row represents data from a single document.
� Column values are typically created using data from or information about a document.
� Excessive numbers of views and poorly designed views can have a serious impact on database performance.
� Views should be designed early in the application development process
Show a view
Open a view in the Instructor database to show students the main elements of a view:
� Rows
� Columns
� Sorting arrows
� Twisties
148 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Introducing Views
The purpose of the View design element is to create an organized list of documents so that users can find the information they need. Views are one of the entry points to the documents stored in a Domino database. All databases contain at least one view. However, most databases contain more than one view.
The following graphic represents the View design element.
Characteristics of a view
The following list describes some of the characteristics of views:
� A view is a list of documents in a database.
� Each row in a view represents a document in the database.
� Each column displays information from or about the document in that row.
� A view may include all documents or a subset of documents based on selection criteria.
� Users read the information in the view to locate specific documents.
� Excessive numbers of views and poorly designed views can have a serious impact on database performance.
� Views should be designed early in the application development process
Student Guide Page No. 75 149
PreviewLesson 4 � Working With Views
Introducing Views...(continued)
Explain how Domino stores views
Emphasize the following points about the the view index
� Domino generates it.
� It is based on the documents the developer determines should appear in the view.
� It determines the order of the documents.
� Domino determines where to store the view index depending on the View type (for example, Shared or Private) and where the database resides.
� Describe the view index and its function.
Delay further discussion about the last bullet until the Explain the guidelines for setting initial view properties section.
150 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Introducing Views...(continued)
How Domino stores a view
Domino uses an internal filing system called the view index to store the list of documents in a view. End users and designers never work directly with the view index. It is built and maintained by the Domino application.
The following table describes how Domino builds a view.
Stage Description
1 The application developer creates the view design.
2 Domino pulls information from documents according to the design and builds a view index.
3 Domino displays the information to users.
The following graphic shows how Domino builds a view.
Student Guide Page No. 76 151
PreviewLesson 4 � Working With Views
Introducing Views...(continued)
Explain how Domino builds a view
The diagram on the Student Guide shows how Domino uses the view design to build a collection and index.
152 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Introducing Views...(continued)
How Domino builds a view
The following diagram illustrates how Domino builds a view.
The Notes Index Facility
The Notes Index Facility (NIF) resides within a Domino database. The NIF is responsible for all tasks that keep documents ordered within each database view. Some of the NIF functions include:
� Open and close collections.
� Update the index.
� Locate notes within an index.
� Locate index entries.
� Update collections.
Student Guide Page No. 77 153
PreviewLesson 4 � Working With Views
Introducing Views...(continued)
Minimizing the number of views
Explain that it is faster for Domino to reorder a collection than open another index.
Show the Click on column header property
Use the Demo\ Views view to show the sort property for the Last Name column.
154 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Introducing Views...(continued)
Minimizing the number of views
Each view builds its own collection and related index, with all the collations or sorts you have specified. When preparing a view for display to a client keep in mind that it is much faster for Domino to reorder a collection that is already open (different sorts in same view) than to open and order a different collection (different views).
Use the Click on column header to sort property to minimize the number of views and maximize the sorting within those views.
The following illustration shows the Click on column header to sort property:
Student Guide Page No. 78 155
PreviewLesson 4 � Working With Views
Designing a View
Instructional methodology
Designing a view is a complex procedure and has been divided into five smaller tasks as listed in the checklist on the Student Guide.
As a developer becomes more comfortable with Designer, these tasks can be done in almost any order. This is an instructional methodology and not intended to be a design methodology.
Tips on designing a view
� Emphasize the importance of understanding the business needs as you design a view.
� Give some real-life examples from your experience.
� Explain that views should show no more or less than the users need to see in order to locate the document(s) of interest.
� Views can make or break an application.
Design a view
Design a new view for the Instructor database with input from the students. Demonstrate how to sketch a simple view on the board for a set of documents. Use this design to demonstrate the many procedures involved in creating a view.
156 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Designing a View
Effective views allow users to find information quickly and easily. As a developer,you must understand the needs of the users.
When designing a view, consider the following:
� Which documents to include in the view
� What information to display in the columns of the view
� How to sort and/or categorize the documents
� Will the view be for shared or private use
� How to format and display the information
Process of creating a view
Follow these steps to design and build a view.
Step Action
� 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 steps will be discussed in more detail in the following sections of this lesson.
Student Guide Page No. 79 157
PreviewLesson 4 � Working With Views
Creating the View
Create a view
Demonstrate how to create a shared view that has no selection conditions.
In the Instructor database, create a view that has these characteristics:
� View name: Whatever you want
� View type: Shared
� Location: Views
� Copy style from: Blank
� Select condition: None
Refresh the view to show that many documents are being viewed.
Note: Continue working with this view as you go through the next several demos.
158 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Creating the View
When designing a view, start by creating an initial view design. The initial view design includes:
� Creating the view
� Naming the view
� Determining the view type
� Controlling how the view will appear in the view list
� Setting the view selection conditions
Creating a view
Follow these steps in Domino Designer to create a new view.
Step Action
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: Domino creates the view and adds it to the list in the Work pane.
Student Guide Page No. 80 159
PreviewLesson 4 � Working With Views
Creating the View...(continued)
Explain the guidelines for setting initial view properties
The following table lists topics to introduce now and expand on later in the course.
Briefly Mention These Topics... More Detailed Information Appears in...
Simple selection conditions Selecting Documents for a View section
Using formulas to build selection conditions Module C: Programming in Domino Applications
160 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Creating the View...(continued)
Guidelines for setting 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 organizes documents.
Type � Select Shared, to create a view many users will access. � Select Shared, contains documents not in any folders, if
the user typically stores documents in folders and wants to quickly find all others.
� Select Shared, contains deleted documents for users to drag out of the trash to a folder, or undelete, if the soft deletions option has been activated.
� Select Private to create a personal view for a single user. � Select Shared, private-on-first-use views to distribute
views that begin as shared, but change to private once a user has accessed and saved the view.
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. � Creates a cascaded list of views.
Note: Typing a backslash (\) after a view’s name with a new name accomplishes the same cascaded view menu.
Copy style from Use the design of another view in the current database as a template.
Selection conditions
� Leave the condition blank to include all documents in the database.
� Click Add Condition and use the Search Builder to specify criteria for including a subset of documents in the view.
� Change the selection conditions after you create the view.
Note: It is better to have one well designed view than a dozen poorly designed views.
Student Guide Page No. 81 161
PreviewLesson 4 � Working With Views
Creating the View ...(continued)
Using an alias
Using an alias is a good habit to practice. Encourage students to adopt a standard naming convention for aliases.
Set properties for a view
Demonstrate how to set the alias and comment for a view.
� In the Instructor database, open the Demo View.
� Enter an alias and comment.
Note: Continue working with this view in the next demo.
162 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Creating the View ...(continued)
Creating an alias for a view
Follow these steps to set properties after creating a new view.
Step Action
1 Open the view in Domino Designer.
2 Open the View properties box.
3 On the Basics tab, enter an Alias and Comment.
Student Guide Page No. 82 163
PreviewLesson 4 � Working With Views
Selecting Documents for a View
Add selection conditions to a view
Demonstrate how to use the Simple Search Builder to add a simple condition to a view.
� Open the Instructor database.
� Add a selection condition to the View Demo view to include only documents that use the Demo form.
� Refresh the view to show the change.
Walk through the different conditions to show how the available options change.
164 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Selecting Documents for a View
Add selection conditions to control which documents a view includes.
Adding selection conditions to a view
Follow these steps to add selection conditions to a view.
Step Action
1 Open the view in Domino Designer.
2 In the Object list of the Programmer’s pane, click View Selection.
3 In the Infolist of the Programmer's pane, ensure that the default is Simple Search. Result: The Programmer’s Pane has an Add Condition button added to the bottom of the script area.
4 In the Script area, click Add Condition. Result: The Simple Search dialog box opens.
5 In the Simple Search dialog box, create a condition. Click OK.
6 Refresh the view index in Designer. Result: Designer rebuilds the view index with the new selection condition.
Student Guide Page No. 83 165
PreviewLesson 4 � Working With Views
Selecting Documents for a View...(continued)
Describe the Simple Search Builder
Point out that the Simple Search feature allows designers to create view conditions without programming. However, if they want to set more complex conditions, then they will use formulas, which will be covered in Module C, Programming in Domino Applications.
Explain to students that in real world examples using the search builder to select documents for a view will sometimes exclude a subset of documents that would otherwise be included if using a select statement.
166 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Selecting Documents for a View...(continued)
Specifying conditions in the Simple Search Builder
The following table describes the types of conditions you can specify in the Simple Search Builder.
Use the Condition... To Find Documents...
By Author Whose author is or is not a specified user or users. Documents 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 next
specified number of days � Between or not between a specified range of dates.
By Field That have a field that contains or does not contain a specified value.
By Form Whose Form field contains the specified form name.
Fill out example form Whose Form field contains the specified form name and whose fields have matching conditions. Only fill out the fields that 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 short phrases.
Note: The Simple Search builder is a tool used mainly by end users to simplify setting view conditions. It does not replace formulas. Developers should use the select statement Formula building will be discussed in Module C, Programming in Domino Applications.
Student Guide Page No. 84 167
PreviewLesson 4 � Working With Views
Selecting Documents for a View...(continued)
Introduce the Guided Practice
The students will first create a new view named Employee INformation. They will limit the documents their Employee Information view includes to documents that they created earlier using the Employee Information form in Lesson 3. If they did not create documents, their view will display nothing.
Allow students five minutes to complete the Guided Practice.
Notes for the Instructor: You can either have the students do the Guided Practices in this lesson as you get to them, or present the content and demos and have them do the Guided Practices all at once before they get to the exercise.
168 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Selecting Documents for a View...(continued)
Create a view with an alias
In this guided practice you will first create a view that is limited to documents created using the Employee Information form.
Follow these steps to create the view.
Step Action Result
1 Open the Practice database.
2 Click Views in the Work Pane.
3 Click New View. The create view box is opened.
4 Choose the following options: � Name: Employee Information � View Type: Shared � Location: Views � Copy from: Blank � Select condition: None
Click OK
A new blank view is created and displayed in the Work pane.
5 Double click to open the view you just created.
A blank view opens in the Work pane.
6 In the View properties Info tab type the following: Alias: ei Comment: This is the first practice view.
7 Close the View properties box.
(continued on next page...)
Student Guide Page No. 85 169
PreviewLesson 4 � Working With Views
Selecting Documents for a View...(continued)
Introduce the Guided Practice
If some students finish before others, have them create new documents using the Employee Information form.
170 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Selecting Documents for a View...(continued)
Create a view, continued
Follow these steps to limit the documents in the view.
Step Action Result
8 In the Infolist of the Programmer's pane, ensure that Simple Search is selected.
9 In the Script area, click Add Condition.
The Add condition button appears at the bottom of the programmer’s pane
10 In the Simple Search dialog box, choose the following: � Condition: By form. � Search for documents which
use form: Employee Information
Click Add.
The condition appears in the programmer’s pane
11 Preview your changes. Only documents created using the Employee Information form should appear.
12 Close the view. Click Yes to save the view.
Result: Your new view, its alias and comment appears in the view list.
Student Guide Page No. 86 171
PreviewLesson 4 � Working With Views
Displaying Information in View Columns
There are four parts to consider when adding a column to a view:
To add a new column, a developer must:
� Add a new column.
� Specify a value for the column to display.
� Format the view column.
� Format the view column values.
Describe how to add a new column to a view
This is the first step in displaying more information in a view.
Describe the difference between inserting and appending a view column.
You can also append a new column by double clicking on an empty area of the column header bar.
172 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Displaying Information in View Columns
Use columns to display information about the documents in the view.
When you create a view using the Blank option, Domino automatically creates one column in the view. This column displays row numbers corresponding to the documents in the view. You can modify this column as well as insert and append new columns.
When creating a column, do the following:
� Add a column to the view.
� Specify a value for the column to display.
� Format the view column.
� Format the view column values.
Adding a new column to a view
You can insert a column to the left of the current column, or append a column to the right of the last column in the view.
Follow these steps to add a column to a view.
Step Action
1 Click an existing column.
2 To add a column to the left of the one selected, choose CreateÆInsert New Column. To add a column to the right of the right-most column, choose CreateÆAppend New Column from the menu.
Student Guide Page No. 87 173
PreviewLesson 4 � Working With Views
Displaying Information in View Columns...(continued)
Describe the types of values view columns display
Describe why columns cannot display these field types:
� Computed for display
� Rich text
� Encrypted (Stay high level on what encrypted fields are because it is beyond the scope of this course.)
Explain that constants can be considered formulas in this context. For example a column with the formula 1.
Note: Module C: Programming in Domino Applications discusses formulas.
Specify view column values
� Open the View Demo view and select the first column.
� In the Programmer’s Pane, select each of the three values, Simple Function, Field and Formula to demonstrate the different options available.
174 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Displaying Information in View Columns...(continued)
Types of values view columns display
The following table describes the three types of values that a view column can display.
Type of Value Purpose
Field Displays the value stored in a specified field for each document in the view. Note: View columns cannot display information from computed for display, rich text, and encrypted fields.
Simple Function Returns information about documents that Domino stores automatically. For example, simple functions can return: � A list of attachments in a document � The size of the attachments � The name of the document’s author � The creation date of the document
Formula Displays multiple field values in a single column or creates new values using the Formula language.
Specifying view column values
After creating a column, specify the information to display in the column. Refresh the view after selecting the value to update the view index and see the change.
The following table explains the three methods for displaying data in view columns.
To Display... Select... And...
A single field value stored in the document
Field Click a field from the list.
Information about the document not contained in fields
Simple Function Click a function from the list.
Multiple fields in a single column or new values
Formula Write a formula.
Displaying multiple fields in a single view column will be discussed in Module C: Programming in Domino Applications.
Student Guide Page No. 88 175
PreviewLesson 4 � Working With Views
Displaying Information in View Columns...
Describe how to format view columns and values
Relate fields on a form to columns in a view. They are both responsible for formatting the information contained in the document. View columns formats are independent of the Form formatting options. For example, a currency field on a form might display an exact currency figure while the same field might be formatted to display only a whole dollar amount in a view.
Recall the discussion of fields. Formatting is not stored with the data. Just as you must specify formatting in fields, you must specify formatting for a view column.
Add and format view columns
Demonstrate how to format view columns to:
� Illustrate the difference between inserting and appending a column.
� Specify column values using simple functions and fields.
� Format the columns.
� Format the column values.
In the Instructor database, use the View Demo view and:
� Change the first column to display the LastName field.
� Name this column Last Name and center the column title
� Insert a column before the Last Name column to display the FirstName field.
� Append a column to display the DateHired field.
� Modify this column to only show the month and year.
176 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Displaying Information in View Columns...(continued)
Formatting view columns
To format view columns, set properties in the Column properties box. The Column properties box has many options available to modify and organize the view columns. We 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 � Width
Title Specify text formatting options for the column title including: � Font � Size � Style
Note that you can change all existing column titles by choosing the Apply to all button.
Advanced � Specify a name for the column to use when accessing the column programmatically. This is similar to giving a form or view an alias name.
� Indicate if the values in the column should appear as links when the view appears on the Web.
Formatting view column values
To specify how a column displays its value, set properties in the Column properties box according to the following table.
In this Tab... Set Properties to...
Font Specify the font, size, and style of text for displaying the column value.
Numbers Specify special options if the column value is a number.
Date and time format
Specify special options if the column value is a date-time value.
Student Guide Page No. 89 177
PreviewLesson 4 � Working With Views
Displaying Information in View Columns...(continued)
Introduce the Guided Practice
Students will modify the Employee Information view they created earlier to display employee names, their department and salaries.
Allow 10 minutes for this Guided Practice.
178 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Displaying Information in View Columns...(continued)
Adding and formatting view columns
In this Guided Practice you will modify the Employee Information view to show employee names and their departments.
Follow these steps to add and format view columns.
Step Action Result
1 In the Practice database, open the Employee Information view in Designer.
The view opens in the Work pane.
2 Select the first column and choose Field in the Programmer’s Pane.
The Programmer’s pane displays all the fields available in the Practice.nsf database.
3 Choose the LastName field.
4 Double click the column header to open the Column properties box and type the title: Last Name,
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
The First Name column appears to the left of the Last Name column.
6 Append a column to the right of the Last Name column with the following features: � Field: Department � Column title: Department
The Department column appears to the right of the Last Name column.
7 Append a column to the right of the Department column with the following features: � Field: Salary � Column title: Salary
The Salary column appears to the right of the Department column.
8 Select the Title tab. Choose Center, Bold and Apply to all.
All the view column titles are centered and bold.
9 Close the Column properties box.
10 Preview your changes.
Student Guide Page No. 90 179
PreviewLesson 4 � Working With Views
Organizing Documents in a View
Show user sorted columns
Open the Demo\Views view to demonstrate user sorted columns.
180 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Organizing Documents in a View
Once you have added columns to display relevant information for the users, organize the list of documents so users can locate a specific document quickly. The sorting tab in the Column properties box provides several different ways to organize documents in a view.
There are two types of sort options you can choose:
� Standard: Sorts documents by the column value in ascending or descending order.
� Categorize: Groups together documents with the same column values.
When you sort or categorize a column, you are changing the order in which the view displays the documents to users.
Sorted columns
A sorted column displays documents in a specific order. The following table describes 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 that could be useful:
� Case sensitive sorting: sorts lowercase letters before uppercase letters -- for example, "ab" sorts before "Aa."
� Accent sensitive sorting: sorts accented characters after non-accented characters. For example, "ab" sorts before "äa."
Student Guide Page No. 91 181
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Sort documents by column value
Explain the options on the Sorting tab.
Demonstrate how to:
� Sort the documents in a view using the column properties.
� Use the Refresh icon to display the changes to the view.
In the View Demo view of the Instructor database, sort the documents in ascending order by last name.
182 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Sorting documents by column value
Follow these steps to sort documents based on the contents of a column.
Step Action
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
Student Guide Page No. 92 183
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Describe the different sort order options
184 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
User sorted columns
The sort column feature allows end users to click on the column header to change the column’s sort order. This option is available in the Sorting tab of the Column properties box.
The following table describes the different end user sort control options.
Option Function
Ascending An upward-pointing triangle appears in the column header. Users click the header to sort in ascending order or revert to the original order.
Descending A downward-pointing triangle appears in the column header. Users click the header to sort in descending order or revert to the original order.
Both A two headed triangle appears in the column header. Users click the header to cycle between ascending, descending and the original sort order.
Secondary Sort Column Designate a second column to further sort the view. For example, if the primary sort column is last name, the secondary could be the first name. Note: this column can be sorted in either ascending or descending order only.
Student Guide Page No. 93 185
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Introduce the Guided Practice
Allow students 5 minutes for this Guided Practice.
186 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Set sort columns
In this Guided Practice you will modify the Employee Information view so users can sort the view by last name then first, if necessary.
Follow these steps to create user sorted columns.
Step Action Result
1 In the Practice database, open the Employee Information view in Designer.
The view opens in the Work pane
2 Double click the Last Name column to open the Column properties box.
The Column properties box opens.
3 Click on the Sorting tab and make the following selections: Click on column header to sort: Both Secondary sort column: First Name Order: Ascending
The Last Name column has a two headed arrow in the column title header.
4 Preview your changes.
Student Guide Page No. 94 187
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Demonstrate creating a categorized view
In the Instructor database, create a view that displays documents created with the Demo form. Include the First name and Last name categorized by department.
188 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Categorized columns
A categorized column groups related documents together in a view based on the column value.
The following graphic shows a categorized view.
Categorizing documents by column value
Always categorize the left-most columns of the view. Typically you will insert a new column to group related documents together in the view.
Follow these steps to categorize a view.
Step Action
1 Select the column whose value will categorize the documents.
2 Open the Column properties box.
3 On the Sort tab, select Categorized.
Student Guide Page No. 95 189
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Demonstrate setting view category best practices
Demonstrate what the view looks like if the best practices listed in the student guide aren’t followed. For example, use a title for the category column, don’t use twisties, etc.
190 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Organizing Documents in a View...(continued)
Guidelines for formatting categorized columns
A view displays the column value of a categorized column in its own row.
The following table lists some best practice guidelines to follow and why.
Guideline Why
Do not use a title for the column. The column values appear in the view and should be self-explanatory. A column title would be redundant.
Set the width of the column to 1. This helps save room in the view to see more data.
Show twisties when the row is expandable.
This simplifies expanding and collapsing different categories for end users.
Use bold and color to make the categorized column value stand out from other information in the view.
This helps the user differentiate between the category headers and the documents.
Student Guide Page No. 96 191
PreviewLesson 4 � Working With Views
Formatting a View
Set view properties
Do not spend too much time on the Options and Security tabs.
Demonstrate how to set the following properties and display the results:
� Background color
� Alternating row colors
� Row spacing
In the Instructor database, modify the view properties for the View Demo view.
192 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Formatting a View
Use the View properties box to format the view.
Formatting a view
The following table describes some of the properties in the View properties box.
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 Domino refreshes the view index. � Set colors for links in a Web browser.
Security � List users who will use the view in the database.
Note: This option does not prevent users from seeing data in the documents displayed in the view. Users could select to display the same documents in another view or folder that they create.
Student Guide Page No. 97 193
PreviewLesson 4 � Working With Views
Exercise: Create a Categorized View
Present the review questions
Before introducing the exercise, go over the following review questions:
� What is a view and what is its function?
� Why should you use the sort capability of a view, rather than build one view for each way that your users want documents to be sorted?
� What should you consider when designing a view?
� List the ways that you can determine the values that a column displays.
� What are some best practice guidelines you should use when categorizing a view?
Introduce the exercise
� Discuss the knowledge and procedures required to complete the exercise.
� Open the Policy form and talk through the data the students should display in the view.
� Encourage students to sketch the view before they start building it.
� Direct students to create the view from scratch.
� Allow 20 minutes for this exercise.
194 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 4 � Working With Views
Exercise: Create a Categorized View
Worldwide Corporation wants to provide a new way of organizing its policies and procedures in the Policies and Procedures application. The view should do the following:
� List documents created with the Policy form.
� Display the title of the policy and its effective date (in that order).
� Organize the documents by the type of policy (Guidelines, Holidays, and so on).
Tasks
� Build a view according to the requirements stated above.
� Name the view Policies.
� Test the view in Notes.
Student Guide Page No. 98 195
PreviewLesson 5 � Working with Pages
Working with Pages
Introduce the lesson
Pages contain content created by application developers. This content can be displayed to users. This lesson examines pages, shared image resources, and sections.
196 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
5
PreviewLesson 5 � Working with Pages
5 Working with Pages
A page is a design element similar in concept to a static HTML page. Domino pages contain text, graphics, and links, and are used to display information.
This lesson introduces the information you need to create and modify a page in an application.
Objectives
After completing this lesson, you should be able to:
9 Describe the page design element.
9 Describe the differences between pages and forms.
9 Create and modify a page in an application.
9 Create and incorporate shared resources.
9 Format information in section.
9 Display pages.
Student Guide Page No. 99 197
PreviewLesson 5 � Working with Pages
What Are Pages?
Define a page
Pages and forms share many elements. However:
� Pages do not have fields to collect and calculate data.
� Users can not create pages. Only developers can.
Note that HTML on a page CAN define fields. Students familiar with HTML may bring this point up.
Describe the types of data stored on a page
Discuss the elements that can be stored on a page.
198 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
What Are Pages?
The page design element is similar in concept and usage to a static HTML page. Domino pages structure and display information that remains relatively stable. Application users do not create pages or add content to pages, but use them to discover information and navigate through a site or application.
Pages can consist of the following:
� Information
� Organizing elements
� Programmable elements
� Navigational elements
All of the elements available to pages are available to forms; however, not all elements available to forms are available to pages.
Caution
Types of information on a page
The following table lists the types of information that can be incorporated on a page.
Element Description
Text Static data such as a company name
Graphics Images such as GIF, JPEG, and BMP files
Organizing elements
The following elements can be used to organize and display information on a page.
Element Description
Tables Information organized in rows and columns
Sections Collapsible and expandable areas that can include text, graphics, and objects
Layers Control the placement, size, and content of information in overlapping blocks.
Student Guide Page No. 100 199
PreviewLesson 5 � Working with Pages
What Are Pages?...(continued)
Describe the types of programmable elements on a page
Describe the types of navigational elements on a page
200 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
What Are Pages?(continued)
Programmable elements
The following programmable elements can be used on pages.
Element Description
Applets Small programs such as an animated logo or self-contained application.
HTML Hypertext Markup Language which can be written directly on the page or imported from another source.
Javascript libraries
A JavaScript library is a place for storing and sharing common JavaScript programs and code. You can insert an existing JavaScript library into a page, form, or subform.
Actions Buttons or hotspots which automate tasks for a user.
OLE objects Links or objects which represent data in another application.
Computed Text
Generates dynamic text based on formula results.
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, perform an action when clicked by a user.
Embedded elements
You can embed the following elements in a page: � A view or folder pane � Navigator � Outlines � Date picker
Use these elements alone or combine them to control how users navigate through your application.
Student Guide Page No. 101 201
PreviewLesson 5 � Working with Pages
What Are Pages?(continued)
Introduce the Guided Practice
Students will open the First Look page.
Allow 5 minutes for this Guided Practice.
202 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
What are Pages?(continued)
Examine a page
Follow these steps to examine a page, its elements and properties.
Step Action Result
1 In the Design pane, select Pages. A list of pages appears in the Work pane.
2 Double-click the First Look page to open it.
The First Look page opens
3 Choose Design Æ Page Properties.
The Page properties box opens.
4 Single click on the following elements to see the different properties boxes: � The IBM logo � The picture � The text
The properties box changes to Pictures and Text.
5 Close the properties box.
Student Guide Page No. 102 203
PreviewLesson 5 � Working with Pages
Differences Between Forms and Pages
Open and run the PagesForms.exe file
Talk through the differences between pages and forms.
Describe the elements available on forms and pages
Open the Designer 6 Help on Designing Pages to direct students to more information
204 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Differences Between Forms and Pages
Pages and forms are similar in many ways. Both display and organize information and both share many elements. Forms, however, can collect information and contain certain elements not available on pages.
Using pages
When developing or updating an application, designers determine when to use a page versus a form to display information.
The following table lists the conditions used to determine whether to use a page or a form.
If the goal is to... Use a...
Display static information such as company data and background information
Page to structure and display information
Collect and store information from end users
Form to structure and display the data
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
Student Guide Page No. 103 205
PreviewLesson 5 � Working with Pages
Creating a Page
Explain the process for creating a page.
Create a page
� Walk through each phase of creating a page as you discuss the process.
� Create a new page in the Instructor database.
� Point out the similarities between creating a page versus a form.
206 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
7
PreviewLesson 5 � Working with Pages
Creating a Page
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.
Creating a page
Follow these steps to create a page.
Step Action
In the Design pane, click Pages.
In the Work pane, click New Page.
Select Design Page ÆProperties
Enter a name in the Name field.
Close the properties box.
Add appropriate elements to the page.
Save the page.
Student Guide Page No. 104 207
PreviewLesson 5 � Working with Pages
Setting Page Properties
Explain page properties
� Reference the diagram of the properties box on the Student Guide page.
208 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Setting Page Properties
In addition to the content that resides on the page, a page contains properties or attributes of its own. Like forms and views, the properties of a page are modified through the properties box.
The following graphic shows the Page properties box. Expand/Collapse Icon
Tabbed
Individual Properties Context
Sensitive Help Icon
Element Name
Panes Close Icon
Student Guide Page No. 105 209
PreviewLesson 5 � Working with Pages
Setting Page Properties...(continued)
Introduce the Guided Practice
Allow 5 minutes for the Guided Practice. If some students have more time, encourage them to experiment setting the page properties, such as background color.
210 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Setting Page Properties...(continued)
Use properties to specify attributes or aspects of a page such as:
� Page name and alias
� Background color
� Background graphic
Create a page
Follow these steps to create a logo page.
Step Action Result
1 Open the Practice database in Designer.
2 Select Pages in the Design List The Pages design list appears.
3 Click on New Page. A blank page opens in the Work pane.
4 Name the page: Practice Page
The page name is set.
5 Type the following text at the top of the page Practice Page. Leave the text left-justified and format it however you like.
6 Save and preview the page.
Student Guide Page No. 106 211
PreviewLesson 5 � Working with Pages
Incorporating Graphics
Explain the ways to add graphics
� Copy and paste.
� Import an image.
� Insert a shared image.
This lesson covers importing an image and inserting a shared image.
There are two different menu bar options when importing a graphic from the file system:
� FileÆ Import � CreateÆ Picture
Both produce the same result, an imported graphic image.
Make sure to note that image size in bytes remains the same regardless if it is scaled down. Images should be optimized prior to importing.
Describe the differences
Briefly describe the differences between:
� Copying and pasting a picture
� Importing it from the file system and
� Inserting it as a shared resource
Talk about your experience with the pros and cons of each option.
212 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Incorporating Graphics
The use of graphics can make an application more appealing and effective. 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 Domino database.
The following image types can be used:
� BMP (Bitmap)
� CGM
� JPEG
� GIF
� Lotus PIC
� PCX
� Tiff 5.0
Images can be used in pages and forms.
Note: Web browsers support GIF and JPEG formats directly. Use these formats when designing for the Web.
Student Guide Page No. 107 213
PreviewLesson 5 � Working with Pages
Incorporating Graphics...(continued)
Import an image
Open the page you created earlier and demonstrate importing an image.
Show both methods of importing an image:
� CreateÆPicture
� File ÆImport
214 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Incorporating graphics...(continued)
Importing an image from a file
Follow these steps to import an image from a file.
Step Action
1 Open the Page in Designer.
2 Place the cursor where you want the graphic to appear.
3 Choose one of the following:
� CreateÆPicture
� 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 Designer page or form.
5 Select or enter the file name.
6 Click Import. Result: The image is inserted onto the page.
Student Guide Page No. 108 215
PreviewLesson 5 � Working with Pages
Incorporating Graphics...(continued)
Describe Picture properties
Point out that the students have already set properties for Pages and now will set properties for a picture.
Describe picture properties and how to use them.
The following properties are typically associated with HTML and web pages:
� Alternate Text
� Caption
� Hotspots
216 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Incorporating Graphics...(continued)
Picture properties
A picture, like other elements, has properties which are modified using the properties box. Once a picture is added, the picture Properties box becomes available. Use properties to specify attributes or aspects of a picture such as:
� Size
� Border style
� Alignment
� Margins
The following graphic shows the Picture properties box:
Element Name Expand/ Collapse Icon
Close Icon
Context Sensitive Help Icon
Tabbed Panes
Individual Properties
Student Guide Page No. 109 217
PreviewLesson 5 � Working with Pages
Using Shared Resources
Define a shared resource
Explain the advantage of using a shared resource
Example: If you use your company logo in many locations throughout an application and the design of the logo changes, you need only change it once, in the image resource. The change will be implemented everywhere that the image is referenced.
Also, mention the security benefit of containment of resources in the database.
Expand the list of resources
Examine the Resources in the Design list.
Note that there are Shared Resources and Shared Code.
218 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Using Shared Resources
A shared resource is an element, such as a graphic file, stored within a Domino database. Each database can contain a library of its own shared resources. Shared resources let you reference a resource multiple times throughout a database, while only having to maintain the resource in one location.
Types of shared resources
Each database can contain a library of shared resources consisting of:
� Images
� Files
� Applets
� Style Sheets
� Data Connections
Shared resource advantages
Using shared resources reduces database maintenance. If a resource is changed, all occurrences of the shared resource are automatically updated. A major advantage of shared resources is that they are a part of the application; if the application is moved, copied or replicated so are its shared resources.
Adding shared resources
To use a shared resource it needs to be imported to the Domino Database. Its native format is maintained during this process.
Student Guide Page No. 110 219
PreviewLesson 5 � Working with Pages
Using Image Resources
Now that the students have been introduced to shared resources, they will be using shared images.
Native format is maintained
Point out that the native format of an image resource is maintained. Once added to the database, the resource can be exported in its native format.
� Select an image from image resources and choose export from the Resource menu.
Add an image resource
Demonstrate how to create an image resource in the Instructor database.
� Select Shared Resources Æ Images in the Design list.
� Click New Image Resource. � Select the any of the available image files.
220 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Using Image Resources
As you saw earlier in this lesson, you can import an image from the file system. However, if the graphic file changes, the image in the application is not updated unless you import it again.
Adding an image resource to a database
The first step in the process of using a shared image is to create an image resource. Follow these steps to create an image resource.
Step Action
1 Click Shared Resources in the Design list.
2 Click Images.
2 In the Work pane, click the New Image Resource button.
3 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.
Student Guide Page No. 111 221
PreviewLesson 5 � Working with Pages
Using Image Resources...(continued)
Specify resource properties
� An image resource has properties like other design elements.
� The difference is the actual image is not opened in the Work pane to access the properties.
222 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Using Image Resources...(continued)
Image Resource properties
Like other Domino Designer elements, image resources have properties which are modified using a properties box.
Use the Image resource properties to specify attributes such as:
� Name and alias
� Source file information
The following graphic shows the Image Resource properties box.
Student Guide Page No. 112 223
PreviewLesson 5 � Working with Pages
Using Image Resources...(continued)
Insert an image resource
� Insert a shared image into the Page you created earlier.
� Preview the Page in Notes and a Web browser.
Show the source information in the properties box
In the Demo page, demonstrate how to:
� View the source information for:
� An imported picture
� A shared image resource
Note that a picture’s source is computable, if appropriate.
224 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Using Image Resources...(continued)
Inserting an image resource
The second step in the process of using a shared image is to insert the image resource where needed.
Follow these steps to insert an image resource.
Step Action
1 Create a new, or open an existing, Page in Designer.
2 Move the cursor to where you want to the image to appear.
3 Choose Create ÆImage Resource from the menu.
4 Choose the type of image (GIF, JPEG, All Images).
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 source
To identify the source of a picture on a page, use the Picture properties box.
The following graphic shows the source of an image added using the Create menu.
The following graphic shows the source of an image that is a shared resource.
Student Guide Page No. 113 225
PreviewLesson 5 � Working with Pages
Using Image Resources...(continued)
Introduce the Guided Practice
In this Guided Practice, students are adding to the Practice Page they created earlier.
Provide students with the location of WWGlobe.gif.
Allow 10 minutes for this Guided Practice.
226 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Using Image Resources...(continued)
Add and use a shared image
In this Guided Practice, create a shared image to use throughout the World Wide Corporation database. This image is part of the company’s new logo.
Follow these steps to complete the Guided Practice.
Step Action Result
1 Create a shared image resource. � In the Element list, click
Shared Resources. Then, click Images.
WWGlobe.gif is added to the list of image resources.
2 Click the New Image Resource button.
3 Locate and add WWGlobe.gif.
4 Open the Practice Page you created earlier.
The Practice Page opens in the Work pane.
5 Add the shared image below the text you added earlier.
� Choose Create ÆImage Resource. Select the WWGlobe.gif image.
� Click OK.
WWGlobe.gif is added to the page.
6 Save and preview the page.
Student Guide Page No. 114 227
PreviewLesson 5 � Working with Pages
What Are Sections?
Define sections
Describe sections and how to use them.
Show a section and how it works
Provide some common examples of sections. For example:
� At the bottom of Designer Help documents, there is a section labeled Related topics.
� The Lotus Web site also uses sections.
228 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
What Are Sections?
A section is a group of paragraphs that users can collapse to a single line. It is an area on a page or form that can be collapsed or expanded by clicking the mouse.
The following table contains examples of a collapsed and expanded section.
If Section State Is... It Looks Like This...
Collapsed
Expanded
Uses for sections
A section can include text, fields, and graphics. Consider using a collapsible section to:
� Make a page less cluttered.
� Collapse information that is referred to only occasionally.
� Collapse information that is not of interest to all users.
Student Guide Page No. 115 229
PreviewLesson 5 � Working with Pages
Creating Sections
Create a section
Open your page:
� Create an untitled section that includes some text and a graphic.
� Open the section’s properties.
� Name the section.
� Examine the other section properties.
Where can sections be used?
Discuss your experiences using sections.
230 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Creating Sections
It is more efficient to add content such as text and graphics to a page and then group that content by creating sections. However, it is possible to create sections prior to adding content.
Creating a section
Follow these steps to create a section.
Step Action
1 Create or open a page.
2 If the content exists on the page, highlight the information to be used in the section. Choose Create ÆSection from the menu.
Result: The section is created. The first line of the section becomes the section title.
3 If the content does not exist, place the cursor where you want to locate the section. Choose Create ÆSection from the menu.
Specifying section properties
The Section properties box allows you to specify the following characteristics:
� Section title border style
� Font attributes for the section’s title
� Expand and collapse options
Follow these steps to specify section properties.
Step Action Result
1 Select the section by clicking the section title.
The Section menu becomes available.
2 Choose Section ÆSection Properties from the menu.
The Section properties box displays.
3 Make the desired changes to section properties.
Student Guide Page No. 116 231
PreviewLesson 5 � Working with Pages
Displaying Pages in Domino Designer
Discuss the methods for displaying a page.
In this lesson the students will simply create a page and preview it in Notes.
232 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Displaying Pages in Domino Designer
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.
Student Guide Page No. 117 233
PreviewLesson 5 � Working with Pages
Exercise: Create A Page
Present the review questions
Before introducing the exercise, go over the following review questions:
� What is a Domino page and what can it consist of?
� How does a page differ from a form?
� What is the benefit of using a shared resource?
� When would you use sections?
Introduce the exercise
Tell the students where the image files are located.
Allow 15 minutes to complete the exercise
234 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 5 � Working with Pages
Exercise: Create a Page
Worldwide Corporation needs a page in the Policies and Procedures application that gives people an overview of the company. In this exercise you will create a page and preview it in the Notes client.
This work should be done in your Policies database.
Tasks
� Create the following shared images:
� LOGO WW1.GIF
� bluerule.GIF
� Create a page named Info that displays the company logo, Logo WW1.gif and the company address 123 Worldwide Blvd. Metropolis, PA 45555 in a table.
� Place bluerule.GIF below the table.
� Enter the following text that describes the company. Give the text a heading.
Worldwide is an international pottery manufacturer. The company sells ceramics worldwide. Products include tiles, china, and various kinds of pottery. The corporate office houses manufacturing, research and development, product management, quality control, human resources, and system administration. There are several smaller sales offices and resellers throughout each region, and some sales representatives who work from their homes.
Create a section that contains the text.
� Save and preview your work.
Student Guide Page No. 118 235
PreviewLesson 5 � Working with Pages
236 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
C Programming in Domino Applications Lesson 6 Introducing Formula Language
Lesson 7 Using Formula Language in Forms
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewLesson 6 � Introducing Formula Language
Introducing Formula Language
Introduce the Lesson
238 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
6
PreviewLesson 6 � Introducing Formula Language
6 Introducing Formula Language
In this lesson you will learn the basics of working with the Formula Language. You will use this information throughout the rest of the course.
Objectives
After completing this lesson, you should be able to:
9 Define the rules and syntax of Formula Language
9 Compute values
9 Compare values using operators
9 Use @Functions in formulas
9 Perform Formula language best practices
9 Interface with the user
Student Guide Page No. 120 239
PreviewLesson 6 � Introducing Formula Language
Working with the Formula Language
Provide simple examples
Instructor Action Important Information
Computing values examples: � Computing the average salary of
a group of employees � Computing the number of
products in an inventory
Point out that the students can find more detailed information on Formula language rules, syntax, etc., in Designer Help.
Comparing values examples: � Comparing dates in a scheduling
application � Comparing two values to see
which is higher or lower
Automating tasks examples: � Updating fields in a group of
documents � Notifying users in a workflow
application
Statements
Describe the elements listed in the table.
240 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Working with the Formula Language
The Formula language provides a straightforward and simple programming interface within Domino applications. Like other programming languages, the Formula language has rules and syntax. Formula language code is generally best used for working with the element that the user is currently processing.
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
Statements
Formulas consist of one or more statements that are made up of a combination of the following components:
Element Description
Variables Variables can be fields or temporary variables.
Constants A constant is something whose value does not change. Constants can be text, numeric, or time-date.
Operators Operators assign values, modify values, and combine values into new values.
@Functions @Functions are built-in formulas that perform a particular calculation and return a value.
Keywords Keywords are reserved words within the Formula language that perform special functions.
Student Guide Page No. 121 241
PreviewLesson 6 � Introducing Formula Language
Working with the Formula Language...(continued)
Explain syntax rules and where to code Formula language
Instructor Action Important Information
Briefly discuss syntax rules and where to code the Formula language.
Show them the Objects tab in the Programmer’s pane.
This leads into a further discussion of objects and events in the next section.
242 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Working with the Formula Language...(continued)
Syntax rules
All programming languages have rules. The Formula language is no exception. A formula must conform to the following general rules:
Rule title Rule description
Statement separators Separate multiple statements using a semicolon. For example: @IsNewDoc(TrueArgument;FalseArgument)
Spaces Any number of spaces, including none, can be used between operators, punctuation, and values. Keywords and functions, however, must be separated by at least one space.
Case Case is not significant except within text constants. By convention, keywords are usually upper case and @function and @commands are usually written in mixed upper and lower case.
Operators and values Two values must be separated by at least one operator.
Where to use Formulas
Formulas 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 an object in the Programmer’s pane.
Student Guide Page No. 122 243
PreviewLesson 6 � Introducing Formula Language
Triggering Events
Describe objects and events
Objects contain events. Events contain code.
Discuss Domino objects, their events, and what triggers the events. Emphasize that the students need to be aware of the event triggers as they plan the code for the application.
Use Domino Designer Help for a complete list of events, their descriptions, and sequencing. Look for the following topics:
� Event descriptions
� Event sequencing
244 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Triggering Events
Code is placed in an event of an object in the Programmer’s pane. The term “object” refers to the element, such as the form, field, etc. For instance, you might create a formula to compute the default value of a field. The list of Domino objects includes, but is not limited to:
� Databases
� Agents
� Actions
� Views
� Forms
� Fields
� Buttons
Description of events
Code executes in response to an event in a Domino object. Events include opening a database, opening a view, opening a document, moving the cursor into or out of a field, etc.
The following table describes several common objects, some of their related events, and what triggers their execution:
Object Event & Timing
Database Postopen - After a database is opened Queryclose - When a database is being closed
Page or Form onHelp - When Help is selected, i.e., when F1 is pressed onLoad - When the Form or Page is loaded PostRecalc - After the object is refreshed (and values are recalculated)
Field Default value - When document is created Input translation - When document is saved onBlur - When the field loses focus onFocus - When the field gets focus
Button Click - When the button is clicked
Student Guide Page No. 123 245
PreviewLesson 6 � Introducing Formula Language
Triggering Events...(continued)
Order of field evaluation
Instructor Action Important Information
Demonstrate this concept using the Demo form in the Instructor demo database.
The FullName field is computed based on the values in the FirstName and LastName fields. Note that you have to save or refresh the document for the FullName field formula to run.
246 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Triggering Events...(continued)
Order of field evaluation on a form
Fields on a form are evaluated left to right, top to bottom. It is important to keep the order of evaluation in mind when designing the forms in your application. For instance, if a field is computed based on the values in one or more other fields on the form, the computed field must be placed after the field(s) used in the computation.
Student Guide Page No. 124 247
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values
Describe constants and fields
� Constants represent static values.
� Fields represent values (items) in a document.
� You will see text constants enclosed in both brackets and quotation marks throughout this course.
248 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values
This section describes how to write formulas to compute and compare values.
Using constants in formulas
Constants represent static information in a formula. The following table shows examples of the three types of constants available in the formula language.
Constant Rules to Apply Examples
Text � Enclose characters in quotation marks.
� Enclose characters in braces.
� “Hello world.”
� {Hello world.}
Numeric � Specify the sign of the number using a plus or minus sign as the first character.
� Use E for scientific notation.
� 10
� -6.37
� 37E6.
Date-Time � Enclose a date in square brackets.
� Use AM and PM to represent time in a 12-hour format.
� [5:30 PM]
� [13:50]
� [7/11]
� [10/18/71 6:30 AM]
Student Guide Page No. 125 249
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values... (continued)
Describe how to combine values using operators
Operators combine field values and static values.
The values that the operators act on must be compatible. If they are not, there are functions available to convert between data types.
Give some examples of using field values in simple formulas
TotalPrice := Price * Quantity
FullName := FirstName + “ “ + LastName
Discuss the order of evaluation in a formula examples
250 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values... (continued)
Combining values using operators
You can only combine values of the same type. For example, you can only multiply numbers.
The following table describes how to use operators to combine values.
To Combine... Use the Operators... For Example...
Number values +
-
/
*
10 + 2.37 + 15
6.05 - 2.35
TotalScore / Quantity
TotalPrice * DiscountRate
Text values + “Welcome, ” + FirstName
Order of evaluation of operations in a formula
When creating formulas that compute values, keep the following in mind:
Order Description
Parenthesis Using parenthesis you can explicitly force the order of evaluation. Operations within parentheses occur first. Example:
(5-3) * (6-4) = 4
Precedence Operations not in parenthesis occur in order of precedence. Example:
5 - 3 * 6 - 4 = -17
Left to right Operation of equal precedence occur left to right. Example:
8 / 4 * 2 = 4
Student Guide Page No. 126 251
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values...(continued)
Explain how to use temporary variables
Students should be able to interpret the @functions used in the example, but you should clearly state their behavior.
Write a few simple formulas on the white board
252 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values...(continued)
Using field values in formulas
A 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 from the current document.
You can use the name of the field as a variable in the formula.
Using temporary variables
Temporary variables only exist within a formula. Use them to make your formulas more modular and readable. You do not need to declare temporary variables before you use them.
Assign a value to a temporary variable using the assignment operator (:=).
For example:
x := @Power(a; 2) + @Power(b; 2);
Then, use that variable in other statements of the same formula.
For example:
@Sqrt(x);
You can also reuse a temporary variable within a formula by assigning a different value it.
Student Guide Page No. 127 253
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values
Describe how to compare values using operators
As with combining values, the values must be the same data type in order for the comparison to make sense.
Write a few simple comparison formulas on the white board
254 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Computing and Comparing Values
This section describes how to compare values in formulas.
Comparing values using operators
Compare values of the same type using the operators. The following table illustrates how comparison operators work.
This Expression.
..
Evaluates to True if... Evaluates to False if...
A = B The values of A and B are equal.
The values of A and B are not equal.
A < B The value of A is less than the value of B.
The value of B is greater than or equal to the value of A.
A <= B The value of A is less than or equal to the value of B.
The value of B is greater than the value of A.
A > B The value of A is greater than the value of B.
The value of B is less than or equal to the value of A.
A >= B The value of A is greater than or equal to the value of B.
The value of B is less than the value of A.
A <> B A >< B A != B
The values of A and B are not equal.
The values of A and B are equal.
(A < B) & (B < C) (A < B) | (A < C) !(A < B)
A is less than B and B is less than C. A is less than B or A is less than C. A is not less than B.
B is less than or equal to A or C is less than or equal to B. B and C are both less than or equal to A. B is less than or equal to A.
Note: A and B represent values and can be constants, variables, or combinations of constants, variables, and operators.
Student Guide Page No. 128 255
PreviewLesson 6 � Introducing Formula Language
Working with @Functions
Discuss how to access information about the application
Discuss these and other useful @functions.
Use Designer Help for more information on @functions
Open Designer Help to @functions A-Z and scroll through the list. Open one or two Help documents of the functions listed on the Student Guide page or show other useful examples.
256 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Working with @Functions
@Functions are built-in formulas that perform calculations and return a value, orperform an action. @Functions are used in Domino design elements to performtasks 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 arguments, if any. The general format of an @function is:
@FunctionName(argument1; argument2; argument3);
Accessing information about the application
The following table describes some of the @functions that return data about the application.
For Information about the...
Use the Function Which Returns...
Current document @Created The date-time value for when the document was created
State of the current document
@IsNewDoc True (1) if the document is new, or False (0) if the document is not new
View @ViewTitle The title of the current view
Database @DbName The server and file name of the current database
User @UserName The current user’s name
User environment @ClientType “Notes” if the client is Lotus Notes or “Web” if the client is a Web browser
Web client @BrowserInfo Determines the capabilities of a Web client
Student Guide Page No. 129 257
PreviewLesson 6 � Introducing Formula Language
Working with @Functions... (continued)
Show a few simple @functions
Use the Formula form to demonstrate several @functions.
The Formula form also contains an @If to demonstrate.
Instructor Action Important Information
Demonstrate how to use a form that displays the formula and then executes it in a field.
Do not try to explain the context of the formula. Focus on the formula itself.
258 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Working with @Functions... (continued)
Examples of @functions
The following table contains common examples of formulas.
This Formula... Returns...
@Adjust ([2/11/99]; 0; 1; -4; 0; 0; 0) The date-time value, 3/07/99
@Text (10) The text value, 10
@ProperCase (“hello world.”) The text value, Hello World.
@Trim (“ hello world. “) The text value, hello world.
Acting on a condition
The @If function executes one statement or another depending on whether a logical value is true or false. The @If statement has an odd number of parameters, with a minimum of three. The parameters are:
� condition - the first parameter is the condition to check
� True statement - the action to perform if the condition is true
� False statement - the action to perform if the condition is false
@If statements are evaluated from left to right. The first true condition evaluated causes its corresponding True statement to be processed.
If an @If statement contains two conditions, the syntax is:
@If( condition1; TrueStatement1; condition2; TrueStatement2; False statement)
The following table shows examples of conditional statements.
This Conditional Statement... Returns...
@If (3<10; “True”; “False”) True
@If (Author = @UserName; “My document”; “Not mine”)
“My document” if the field Author contains the name of the current user.
Student Guide Page No. 130 259
PreviewLesson 6 � Introducing Formula Language
Formatting and Commenting Formulas
Explain why formatting formulas is a good idea
We want to teach developers new to Domino good coding habits from the very beginning. Therefore this section of the course includes information on coding “best practices.”
260 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Formatting and Commenting Formulas
In order to make your code easier to read and debug, it is good practice to include comments and formatting. This not only helps the person who developed the code, it also helps any developer who may have to modify the code at a later date.
Formatting Formula language
Formulas can get quite lengthy, particularly when using nested @If statements. To make complicated formulas easier to read, use line breaks and indenting. For example, look at the following formula. Even an experienced Domino developer would have to study this code to interpret what it does.
@If(Invoiceamount>POamount;@If (Invoiceamount-POamount>1000.00;@Mailsend(Vendor:Approver;"";"";"Rejection";"Invoice"+ invoiceno+ " has been rejected");@Mailsend(Approver;"";"";"Invoice overage";"Invoice"+ invoiceno+"has been submitted"));@Mailsend(Vendor:Approver;"";"";"Processed";"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, True, and False statements start on separate lines. The statements related to a condition are indented under the condition.
The formula gets even easier to understand when you add comments.
Student Guide Page No. 131 261
PreviewLesson 6 � Introducing Formula Language
Formatting and Commenting Formulas...(continued)
Explain the importance of commenting code
Commenting code is very good habit to develop so that with a quick glance one can look at a piece of code and know what it is supposed to do immediately without having to take it apart and figure it out.
262 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 6 � Introducing Formula Language
Formatting and Commenting Formulas...(continued)
Commenting Formula language
By adding explanatory text to any code that you write, your applications become much easier to maintain. Documenting code is best done while you are writing it.
Use the REM keyword to include comments in Formula language code. The syntax is:
REM { comments };
Include a REM statement at the beginning of each line of explanatory text in a formula.
The following example contains several lines of explanatory text before the formula starts. It also contains REM statements inside the formula to further document what the code is doing.
REM {An invoice amount is checked against};REM {its corresponding Purchase Order to see if the invoice };REM {exceeds the amount of the PO. If it does exceed the PO };REM {amount by more than $1,000, an email 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 email };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 email 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"))
Student Guide Page No. 132 263
PreviewLesson 6 � Introducing Formula Language
Exercise: Interpret Formulas
Present the review questions
Before introducing the exercise, go over the following review questions:
� Describe the types of operations you can perform with the Formula language.
� What is an event?
� What are constants?
� What is a temporary variable and when do you use them?
Introduce the exercise
� Direct the students to use Help if they do not know what the @function does.
� Allow 10 minutes for this exercise.
Review the exercise
� Discuss the knowledge and procedures required to complete the exercise.
� Go through the formulas together so students can be sure they got them right. Describe the behavior of the @functions.
� Discuss and resolve any doubts on the results of the formulas.
264 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
PreviewLesson 6 � Introducing Formula Language
Exercise: Interpret Formulas
A document contains the following fields and values:
FirstName: SusanLastName: SunshineCreated on 3/7/99 at 11:59:37 PM
Tasks
Based on the information above, determine the result for each formula in the following table.
Formula Result
FirstName
“LastName”
FirstName + LastName
LastName + “, “ + FirstName
FirstName = “Susan”
(FirstName != “Larry”) & (LastName = “Sunshine”)
7 @Adjust (@Created; 0; 6; 0; -2; 0; 0)
8 @If (@Created < @Today; “Old”; “New”)
9 @Text (10.22)
10 fullName := FirstName +“ “ + LastName;
“Welcome back, “ + fullName
Student Guide Page No. 133 265
PreviewLesson 7 � Using Formula Language in Forms
Using Formula Language in Forms
Introduce the lesson
Using formulas in forms and fields allows you to calculate, display, and store dynamic information. This lesson will take a closer look at the Programmer’s pane.
266 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
7
PreviewLesson 7 � Using Formula Language in Forms
Using Formula Language in Forms
Use formulas in forms to automatically add, calculate, and format data. With formulas, you can:
� Display one title when the document is new, and another title when the document is being edited.
� Calculate ending dates based on start dates and lengths.
� Enter the document creation date.
� Populate a list of options.
� Ensure that users do not save the document with specified fields left empty.
� Format user entries to be consistent in all documents.
Objectives
After completing this lesson, you should be able to:
9 Set the window title of a page or form.
9 Create computed text fields to dynamically display values.
9 Use values in a view column as choices in a field.
9 Create computed fields to dynamically store values.
9 Set default values for editable fields.
9 Write input translation formulas to automatically format user entries.
9 Write input validation formulas using @Failure and @Success.
9 Write reusable code
9 Interact with users using prompts
Student Guide Page No. 134 267
7
PreviewLesson 7 � Using Formula Language in Forms
Adding Code to a Form
Describe adding code to a form
The Programmer’s pane gives the designer a different look at the same design elements in the Work pane. It exposes properties and events of the objects on the design element and the design element itself.
Examine the Programmer’s pane
Students have already worked with the Programmer’s pane. Now take a little time and walk them through it.
� Open a form in Designer and show students where to add formulas and how to use the reference tabs.
� Open the Programmer’s Pane properties box and customize the colors.
268 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Adding Code to a Form
Use formulas to perform such operations as:
� Set the window title for a page or form.
� Display values on a page or form.
� Compute choices for a list field.
� Compute values to store in a document.
� Add logic to editable fields.
Programming a form
Each element of the form, including the form itself, is an object. The Programmer’s pane provides access to the programmable properties and events of objects on the form.
Adding a formula in the Programmer’s pane
Follow these steps to add a formula to an object in the application.
Step Action Result
1 Select the object either: � On the form in the Work pane � From the Objects tab in the
Programmers pane
Designer highlights the object in the Objects tab and displays the programmable properties and events of the object.
2 Select the property or event to which you want to add a formula.
Designer highlights the property or event.
3 At the top of the Script area, select Client and Formula.
The Reference tab lists the database fields and @functions that can be used in the formula.
4 Enter the formula. Designer highlights different elements of the formula with colors.
5 Save the formula. Designer checks the syntax of the formula.
Student Guide Page No. 135 269
PreviewLesson 7 � Using Formula Language in Forms
Creating a Window Title
Demonstrate using window titles
In this demo, take the students through the following progression:
Instructor Action Important Information
Show the students a form which has no window title. Use the Demo form in the Instructor demo database. Preview the form in the Notes Client.
Point out that the title displays as “Untitled.”
Enter a hard-coded window title such as “Demo Form.” Preview the form in Notes.
The title displays the text entered.
Next, enter a formula such as the following:
{Demo form for } + FirstName
This time when you preview the form in the browser, note that the text displays, but no name exists yet to display. This leads to the next step.
Now talk about the difference between a new document and an existing document. Tell the students that two @functions that are particularly useful for this type of window title are @If and @IsNewDoc.
They have seen @If already. @IsNewDoc is discussed on the following page.
Continue this demonstration on the next page after discussing @IsNewDoc.
270 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Creating a Window Title
Both forms and pages contain a property called the window title. You can write a formula to compute a text string to display in the upper left corner of the client when users open the element.
Guidelines
It is good practice to always set the window title when designing forms and pages.
If the form or page opens in a frameset, the window title will not display in a Web browser.
Setting the window title
Follow these steps to set the window title of a form or page.
Step Action
1 In the Object tab of the form or page, select window title.
2 Enter a formula that results in a text value.
3 Save the formula.
4 Preview the page or form.
Student Guide Page No. 136 271
PreviewLesson 7 � Using Formula Language in Forms
Creating a Window Title... (continued)
Continue the window title demo after discussing @IsNewDoc
Instructor Action Important Information
Ask the participants how to write a formula to display some text plus the contents of the FirstName field if the document has been saved.
This will reinforce what they learned in the previous lesson.
Go back to the Demo Form in Designer and add the following formula:
@If(@IsNewDoc;”New Demo Document”; “Demo document for “ + FirstName)
Note: use the formatting guidelines discussed in the last lesson whenever you enter a formula.
Preview the form in Notes.
Point out that when the new document first opens it displays New Demo Document. You can enter a value in the First Name field then save, but do not close the document. Point out that the window title changed.
Note: You don’t actually need to specify a window title for a page unless you want to display something other than the page name. Unlike forms, pages do not display untitled.
272 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Creating a Window Title... (continued)
Using @IsNewDoc
The function @IsNewDoc is particularly useful when creating a window title. Window titles that incorporate a field from the document will not display the window tittle correctly when the document is new and there is no data yet. By combining @IsNewDoc and @If you can create a formula that displays one text phrase if the document is new, and another if the document is not new.
The syntax for @IsNewDoc is simply:
@IsNewDoc
The function returns a value of 1 for True if the document has not yet been saved. It returns a value of 0 for False if the document has been saved.
Example of writing a formula using @If and @IsNewDoc
The following example illustrates how to combine @If and @IsNewDoc to create a meaningful window title:
@If(@IsNewDoc;"New Document";Subject)
In this case, the phrase “New Document” displays if the document is new. If the document has been saved, the window title changes to the value in the Subject field of the document.
Student Guide Page No. 137 273
PreviewLesson 7 � Using Formula Language in Forms
Displaying Computed Values
Discuss useful @functions
Describe other simple @functions that are useful.
Name a function and ask students to describe its functionality. Encourage the participants to use Designer Help.
Set the values of Computed for display fields
Show the students how to:
� Use functions and fields as values in Computed for display fields.
� Identify when the formula executes.
� Use the Document properties box to verify that the document does not store the value.
Instructor Action Important Information
In the Instructor database, add a Computed for display field to the Demo form.
This field should display the creation date of the document.
274 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Displaying Computed Values
Among the ways to compute values that display on a form, are:
� Computed for display fields
� Computed text
Using Computed for display fields
Computed for display fields are recalculated every time a user opens or saves a document, or when the document is refreshed.
The contents of a computed for display field are not stored in the document.
The following table describes examples of using Computed for display fields.
Use a Computed for Display Field to 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 the document is open WorkType
Computed for display fields require a formula. The formula must evaluate to a value suitable for storage in the field. For example, if the type of field is date-time, the formula must result in a date-time value.
Student Guide Page No. 138 275
PreviewLesson 7 � Using Formula Language in Forms
Displaying Computed Values... (continued)
Add computed text to a page and form
Show participants how to:
� Use functions and fields as values in computed text.
� Identify when the formula executes.
� Use the Document Properties box to verify that the document does not store the value.
Instructor Action Important Information
Create a new page and name it Welcome Page.
Add computed text to the top and format the text to be big and bold in order to make it stand out.
Enter a formula that welcomes the current user to the application, for example:
"Welcome to the class " + @Name([CN]; @UserName)
276 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Displaying Computed Values... (continued)
Using computed text
Computed text is another element you can add to a form or page. It is similar to a Computed for display field, except that the result of the formula must be a text value.
You can format computed text like other text elements using the Computed Text properties box.
The following table describes examples of using computed text.
Use Computed Text to Display...
Example
Different text based on a condition
@If ((DueDate < @Today) & (Status != “Complete”); “This is late!”; ““)
Dynamic messages “Welcome, “ + @Name([CN]; @UserName)
Adding computed text
Follow these steps to add computed text to a form.
Step Action Result
1 Open the form or page in Designer.
The form appears in the Work pane and the Programmer’s pane opens.
2 Place the cursor where you want the result of the computed text to appear.
3 Choose CreateÆComputed Text.
The Computed Text properties box opens. The value property of the new computed text object is highlighted in the object list.
4 Enter a formula that evaluates to a text value in the Script area of the Programmer’s pane.
Designer checks for formula syntax errors.
5 Set properties to format the text. The result of the formula in Step 4 will display according to the properties you set.
6 Preview the page or form. The result of the formula displays in the form or view.
Student Guide Page No. 139 277
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Create a Dynamic Title for the Policy Form
Introduce the exercise
Allow 10 minutes for this exercise.
278 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Create a Dynamic Title for the Policy Form
Worldwide Corporation would like to customize the titles displayed to users when they open certain documents. The tasks below describe what you need to do.
Tasks
� When a Policy document is opened, check to see if it is new or not. Display either the title of the Policy, or “New Policy” depending on the state of the document.
Student Guide Page No. 140 279
PreviewLesson 7 � Using Formula Language in Forms
Storing Computed Values
Explain how to work with computed fields
Provide further information on, and examples of, when to choose which type of field to store information.
Set the value of a computed field
Demonstrate how to write formulas for Computed and Computed when composed fields to store values in documents. Preview the form and save the document. Open the document again and force the computed field to recalculate.
In the Instructor database on the Flower form, do the following:
� Modify the FlowerEnterer field so it has the following properties:
� Type: Computed when composed
� Value: @UserName
� Add another field with the following properties:
� Name: FlowerTotalPrice
� Type: Number, Computed
� Value: FlowerShipPrice + FlowerPrice
� Illustrate the behavior of both types of computed fields by creating and editing documents with the modified form.
280 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Storing Computed Values
To store values in a document, you must use one of the following types of fields:
� Computed
� Computed when composed
� Editable
This section describes how to use these field types and set their values.
Working with computed fields
The following table describes Computed and Computed when composed fields.
Field Calculates a Value... Example
Computed Each time users create, refresh, or save the document.
The result of a calculation involving other fields, such as calculating a total
Computed when composed
Only the first time users save the document.
The original author A value that never changes The date the document was created.
Setting the value of a computed field
Follow these steps to add a formula to calculate the value of a computed field.
Step Action
1 Open the form in 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.
Student Guide Page No. 141 281
PreviewLesson 7 � Using Formula Language in Forms
Storing Computed Values... (continued)
Explain using formulas in editable fields
Explain how to specify a Default value
This is very similar to setting the value of a computed field.
282 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Storing Computed Values... (continued)
Using formulas in editable fields
Gather information from users through editable fields. To improve the usability 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 value
Specify an initial value for an editable field in the Programmer’s pane. Add the formula to the field’s Default value property. The formula executes only when users create documents.
Student Guide Page No. 142 283
PreviewLesson 7 � Using Formula Language in Forms
Translating Field Values
Explain how to work with input translation formulas
Input translation formulas:
� Run before saving to ensure consistent user input.
� Do not apply to rich text fields.
Discuss text formatting functions
Direct students to Designer Help for more information on these and other useful functions.
284 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Translating Field Values
You can automatically format data by specifying an input translation formula for editable fields. Using an input translation formula, you can format such things as:
� Telephone numbers, by adding parentheses, hyphens, or periods
� Proper nouns, by capitalizing only the first letter
Working with input translation formulas
The input translation formula is triggered when the document is saved or refreshed. The input translation formula adjusts or re-formats the value.
The result of an input translation formula must evaluate to the same type of value specified by the field. For example, if you are translating a text field, the formula must evaluate to a text value.
Text formatting functions
There are several @functions available for formatting text. The following table describes some of these functions.
Function Description
@Trim Removes leading, trailing, and redundant spaces in a text string.
@ProperCase Capitalizes the first letter of each word in a text string.
@UpperCase Converts all letters in a text string to uppercase.
@LowerCase Converts all letters in a text string to lowercase.
Student Guide Page No. 143 285
PreviewLesson 7 � Using Formula Language in Forms
Translating Field Values... (continued)
Write an input translation formula
Demonstrate how to write a simple input translation formula for a field.
In the Instructor database on the Flower form, write an input translation formula for the FlowerShipTime field to round the user’s entry to the nearest whole number using @Round.
Introduce the Guided Practice
Instruct students to use Help for any @functions they don’t know.
286 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Translating Field Values... (continued)
Writing an input translation formula
Follow these steps to write an input translation formula.
Step Action
1 Select the field.
2 In the Objects tab of the Programmer’s pane, select the field’s Input Translation event.
3 Write the translation formula in the Script area.
4 Save the form.
5 Test the formula: � Preview the form. � Enter a value and refresh the document.
Interpret input translations formulas
Follow the steps below to complete the Guided Practice.
Step Action
1 Open the Practice database in the Notes client.
2 Choose CreateÆTranslation Demo.
3 Work through the translation formulas.
4 Click Mark Now to see your results
Student Guide Page No. 144 287
PreviewLesson 7 � Using Formula Language in Forms
Validating Field Values
Explain how to work with input validation formulas
Input validation formulas:
Run before saving and after input translation to ensure correct user input.
Do not apply to rich text fields.
Discuss using @Success and @Failure
Use Designer Help for more detailed information on these functions.
288 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Validating Field Values
You can stop users from saving documents with incorrect or incomplete values by specifying an input validation formula when designing editable fields.
Working with input validation formulas
When users save or refresh documents, the input validation formulas are triggered. The input validation formula is a conditional statement that:
� Determines if the value is acceptable or not.
� If the value is acceptable, continues saving the document.
� If the value is not acceptable, displays a message to users indicating that the value is not acceptable and aborts the save operation.
Note: The input validation formula runs after the input translation formula.
Using @Success and @Failure
Use the functions @Success and @Failure as the actions in the input validation formula.
The following table describes how to use the two functions when validating field values.
If the Field Value Is...
Use this Function... To...
Acceptable @Success Continue saving the document
Not acceptable @Failure Display a pop-up message box directing users to fix the problem. Abort saving the document.
Student Guide Page No. 145 289
PreviewLesson 7 � Using Formula Language in Forms
Validating Field Values... (continued)
Provide examples of input validation formulas
Provide more examples of input validation formulas.
Write a field input validation formula
Demonstrate how to write a simple input validation formula for a field and preview it in Notes.
In the Practice database, write an input validation formula to abort saving if users do not specify a value for the FlowerName field.
290 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Validating Field Values... (continued)
Examples of input validation formulas
The following code verifies that a new number entered by a user is within a specific range.
@If (NewNumber >= LowValue & NewNumber <= HighValue; @Success; @Failure (“Please enter a value between ” + @Text(LowNumber)
+ “ and “ + @Text (HighNumber))
The following code verifies the field contains a value.
@If (Title != ““; @Success; @Failure(“Please enter a value.”))
Writing a field input validation formula
Follow these steps to write a field input validation formula.
Step Action
1 Select the field.
2 In 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 document.
Student Guide Page No. 146 291
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Automate Data Entry and Formatting
Introduce the exercise
Allow 30 minutes for this exercise.
� Show the students what the final form looks like to give them an idea of what they need to accomplish.
� Discuss the knowledge and procedures required to complete the exercise.
� Verify that students used the appropriate computed field types and formulas.
Notes for the Instructor: The students are likely to place the effective date field above the policy created date field on the form. This means the effective date formula won’t work. You can either warn them, or let them do it wrong to help make the point about order of evaluation more clear.
292 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Automate Data Entry and Formatting
During this exercise you are going to automate data entry and formatting in the Policy form. Here is a list of the functionality that Worldwide would like to incorporate into the application:
� The policy title should be formatted using proper case.
� Create a field to capture the date the policy is created. This date should be displayed without the time element. Name it PolicyCreatedDate.
� The effective date should calculate to one month from the date the policy is created in order to account for an internal review process. This date should also be displayed without the time.
� When a policy is created, the document should not be saved unless it contains a title and category.
Tasks
� Implement the above specifications.
� Preview the form and test your formulas.
Student Guide Page No. 147 293
PreviewLesson 7 � Using Formula Language in Forms
Working with Lists
Explain the value of working with lists and the usefulness of the list-related @functions
294 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Working with Lists
In Domino a list is defined as a named entity that contains multiple values of the same data type. The return value of some @functions is a list. Fields that allow multiple values contain lists. Constants and variables in formulas can contain a list. You can also present lists to a user using a prompt box.
Multiple elements in a list are separated by a colon (:). For example, the following code defines a temporary variable and assigns a list of text elements to it:
cities := {New York} : {London} : {Paris} : {Boston};
Using @functions to manipulate lists
The following table contains @functions useful for working with lists.
@Function Usage Example
@Elements(list) Returns the number of elements in a list
@Elements(Colors)
Returns: the number of elements in the Colors field.
@Explode(String; separator)
Splits a string into a list of values using the specified separator.
@Explode(“Red Green Blue”; “ “)
Returns: “Red”:”Green”:”Blue”
@Implode(list;separat or)
Converts a text list into a string using the specified separator
@Implode(“Red”:
”Green”:”Blue;”*”)
Returns: Red*Green*Blue
@IsMember(value; list)
Returns true if the value is a member of the list
@IsMember(“Orange”;”Red” : “Green”: ”Blue”)
Returns: 0 (False)
@Member(value;list) Returns the number of the element in the list
@Member(“I”;”A”: “E”:”I”:”O”:”U”)
Returns: 3
@Subset(list;number) Returns a portion of the list containing the number of elements specified by num.
@Subset({A}:{E}: {I}:{O}:{U};2)
Returns: {A}:{E}
@Unique(list) Removes duplicates from a list
@Unique({A}:{E}: {I}:{E})
Returns: {A}:{E}:{I}
Student Guide Page No. 148 295
PreviewLesson 7 � Using Formula Language in Forms
Working with Lists...(continued)
Working with Lists exercise
Have the students open the ListsDemo form in the Notes Client. Allow them 10 minutes to work through the formulas. The form is set up with a Mark Now button that evaluates their answers.
296 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Working with Lists...(continued)
Evaluate list formulas
Perform the steps below to complete this exercise. Use Designer Help to help evaluate the formulas.
Step Action
1 Open the Practice database in 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 your results.
Student Guide Page No. 149 297
PreviewLesson 7 � Using Formula Language in Forms
Computing the Choices in List Fields
Describe how to create dynamic lists
Review the different types of list fields and describe the concept of creating dynamic lists with formulas.
Explain how to compute the list of choices in a field
Describe how to use @DbColumn
� Describe the function.
� Refer students to Help for more information.
298 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Computing the Choices in List Fields
In Module B: Working with Design Elements, you learned about the differenttypes of fields, which include fields that offer a pre-defined list of choices to the user. To define the list of choices, you can do either of the following:
� Enter each choice.
� Write a formula to calculate the choices.
Adding a formula to compute the list of choices in a field
Follow these steps to create a list of choices using a formula.
Step Action
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.
Using values in a view as choices in a field
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, you can avoid updating the list manually as data changes.
Student Guide Page No. 150 299
PreviewLesson 7 � Using Formula Language in Forms
Computing the Choices in List Fields... (continued)
Use @DbColumn in a list field
Write an @DBColumn formula to compute a list of departments. The Instructor demo database contains a Departments view with departments listed in the first column.
Instructor Action Important Information
Open the @DbColumn demo form.
Make the Departments field an editable dialog list.
On the Control tab, select Use formula for choices.
Enter the following formula. Explain the code as you enter it.
source := "Notes":""; location := "":""; view := "Departments"; colNumber := 1; @DbColumn(source; location; view; colNumber)
The use of temporary variable in @DbColumn formulas is good practice and makes the code much easier to read.
300 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Computing the Choices in List Fields... (continued)
Working with @DbColumn
The syntax of @DbColumn is:
@DbColumn( class : mode ; server : database ; view ; columnNumber )
The following table describes each parameter in the formula.
Argument Data Type Description
class : mode Text list � Indicates the type of database (class) you are accessing and whether to cache the results.
� For example, "":"", accesses a Domino database and caches the results.
server : database
Text list � Specifies the location and file name of the database
� For example,""“:"", refers to the current database.
view Text � Specifies the name of the view.
columnNumber Number � Specifies the column number within the view.
Example of using @DbColumn
The example formula below is based on the following characteristics:
� The view name is In Progress.
� The view is located in the Tracking database on Server01.
� The first column contains the title of all projects currently in progress.
The formula returns a list of all the projects currently in progress (note the use oftemporary 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)
Student Guide Page No. 151 301
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Compute a List of Choices for a Field
Introduce the exercise
Discuss the knowledge and procedures required to complete the exercise.
Allow 30 minutes.
302 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Compute a List of Choices for a Field
To make the policy application easier to maintain over time, create a view that contains the policy categories in the first column. When a policy is created or edited, the categories should be displayed from the Categories view. In order to accomplish this:
� Create a Category form containing a field called Category.
� Create Category documents with the following categories:
� Office Guidelines
� Benefits
� Holidays
� Grievance Procedures
� Security
� Email Etiquette
� Diversity
� Create a view called Categories that only displays the Category documents.
� Modify the Policy form to perform a lookup to the Categories view to produce the list for the Category field.
Hint:
The view should only display documents created with the Category form.
Tasks
� Implement the above specifications.
� Preview the form and test your formulas.
Student Guide Page No. 152 303
PreviewLesson 7 � Using Formula Language in Forms
Interfacing with the User
Discuss uses for @Prompt
304 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Interfacing with the User
What do you do when you need to prompt a user for information in your application? If you’re working with the formula language you use the @Prompt function. @Prompt allows you to create a more interactive interface for Notes applications. The @Prompt function allows users to enter values, respond to questions or choose from a list of choices.
There are many different styles of prompt boxes, and the prompt boxes can be triggered in different ways. @Prompt can be used in fields, hotspots (buttons), agents, and toolbar buttons.
@Prompt does not toggle the modified flag of the document. Therefore, if a forms uses only @Prompts to collect data and set fields, the user could close the document and not be prompted to save it.
Caution
Syntax for @Prompt
The syntax for @Prompt is:
@Prompt( [style] : [ NOSORT ] ; title ; prompt ; defaultChoice ; choiceList ; filetype )
The following table describes the parameters for @Prompt.
Argument Data Type Description
style Keyword Indicates the type of dialog box to display.
NOSORT Keyword Indicates whether to sort the list of choices or not.
title Text The title for the dialog box.
prompt Text The text your 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 the LOCALBROWSE style
The following example shows a simple @Prompt formula:
@Prompt([OK];”Prompt box”;”You did it! Click OK to close.”)
Student Guide Page No. 153 305
PreviewLesson 7 � Using Formula Language in Forms
Interfacing with the User...(continued)
Demonstrate different @Prompt formulas
Instructor Action Important Information
In the Instructor database, open the Prompt Demo form in the Notes Client.
This form resides in the Practice database as well. Have the students open it, too.
Click each button to demonstrate each type of @Prompt. Discuss what you would use each type of @Prompt for.
Have the students follow along.
After stepping through the form in the Notes client, review the button formulas in Designer.
Demonstrate when form events are triggered
Instructor Action Important Information
Use the Events form in the Instructor database to demonstrate when form events are triggered.
This form exists in the Practice database as well if you want to have the students follow along.
306 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Interfacing with the User...(continued)
Triggering @Prompts
Prompt dialog boxes can be triggered in the following ways:
Trigger Description
Field formulas Use @Prompt to prompt the user to enter a value in a field.
Button formulas @Prompt can be used in buttons to take input from a user.
Form and View action buttons or manual agents
@Prompts are useful in Action buttons and agents. For example, you could prompt the user for a value and set the value of a field based on what the user enters.
Password field formulas In combination with @Password, @Prompt can be used to prompt for a password on a form.
Using Form Events
Form events are triggered when a document is opened, saved, refreshed, closed, or switched between read and edit mode. You can use formulas in form events to set 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 read mode.
PostModeChange After the document is changed into either read or edit mode.
PostRecalc After the document has recalculated, usually after F9
QuerySave Before the document is saved
PostSave After the document is saved
QueryClose Before the form is closed.
Student Guide Page No. 154 307
PreviewLesson 7 � Using Formula Language in Forms
Creating Reusable Code
Explain the benefits of writing reusable code.
Demonstrate the use and reusability of formulas created using @ThisValue and @ThisName
Instructor Action Important Information
In the Instructor database, open the form named Portable Code and preview it in Notes.
Try to enter an email address without first entering a Contact name. Click OK to close the error message.
Enter a Contact name, then try to select an item without entering a phone number. Click OK to close the error message.
Point out that the code in the Contact name, Phone number, and Email fields is exactly the same.
Open the Portable Code form in Designer and show students the identical input formulas for each of the three fields (ContactName, ContactPhone and ContactEmail).
Switch back to the Portable Code form in preview mode, and now that you have filled in the three contact fields, click the Get Prices action without first selecting an item in the Items field.
308 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Creating Reusable Code
The ability to create reusable code is possible in Formula language using @ThisValue, @ThisName.
This feature is new in Domino 6 and will not work on previous versions of the software.
Caution
Accessing fields without hard-coding the field names
Creating reusable code means creating code that can be used in multiple places without changes to the code. Developers can save time by writing a formula once and reusing it in many different places. Using @This Value and @This Name has the following benefits:
� You do not need to hard code field names.
� You can write code once that you can then cut and paste into multiple fields throughout an application.
� You do not need to manually revise code every time a field name changes.
Using @ThisValue and @ThisName
@ThisName and @ThisValue are especially useful for creating reusable input translation and validation formulas. The purpose of these @functions is described in the table below.
@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 requires more than one selection, you can use @ThisValue to check whether a user has selected more than one list option, and, if not, use @ThisName to prompt the user to select a second option. The formula would look like this:
@If((@ThisValue != "") & (@Elements(@ThisValue) = 1);@Failure("The " + @ThisName + "field must contain more than
one choice");@Success)
Student Guide Page No. 155 309
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Create Reusable Code
Present the review questions
� What types of operations would you perform using formulas in a form?
� What types of fields display, but do not store, computed values on a document?
� What types of fields store computed values in a document?
� Why would you use an input translation formula?
� Why would you use field validation? Does it run before or after the input translation event?
� What are the two ways that you can build a list in a field?
� What @function lets you gather information from a user in a dialog box?
� Which @functions return the value and the name of the current field and what are the benefits of using them?
Introduce the exercise
Allow 20 minutes.
310 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 7 � Using Formula Language in Forms
Exercise: Create Reusable Code
To ensure that certain fields are populated on your Employee Information form, create reusable code that checks to see if a value is entered in the first name, last name, and salary fields.
Tasks
� Create a reusable formula.
� Copy it into the appropriate fields.
� Save and test your form.
Student Guide Page No. 156 311
PreviewLesson 7 � Using Formula Language in Forms
312 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
D Enhancing Design Elements Lesson 8 Enhancing Forms
Lesson 9 Enhancing Views
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewLesson 8 � Enhancing Forms
Enhancing Forms
Introduce the lesson
This lesson covers a diverse set of topics which are all related to enhancing the appearance and functionality of forms.
314 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
8
PreviewLesson 8 � Enhancing Forms
8 Enhancing Forms
Earlier in the course you created forms to collect and display information. In this lesson you will learn to use form design elements to increase the functionality and presentation of the forms in your Domino application.
Objectives
After completing this lesson you should be able to:
9 Use layers to control the display of information.
9 Create subforms.
9 Add a subform to a form.
9 Add a calculated subform to a form.
9 Create shared fields.
9 Add shared fields to a form.
9 Inherit data from one document to another.
9 Create response documents.
Student Guide Page No. 158 315
PreviewLesson 8 � Enhancing Forms
Working with Layers
Introduce layers
316 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Layers
Layers are used to position overlapping blocks of content on a form, subform or page. Make note of the following when working with layers on forms and pages:
� Layers on a form or subform can contain anything a form can contain.
� Layers on a page can contain anything a page can contain.
This lesson focuses on using layers on a form.
Benefits of working with layers
There 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. For example, different layers containing text and images can be stacked for a high-impact page title.
� Layers can be transparent or opaque, depending upon the type of effect desired.
Content of a layer
Add content to a layer just as you would add content to a form. You can copy and paste from another form or layer, type directly in the layer, or add graphics.
Student Guide Page No. 159 317
PreviewLesson 8 � Enhancing Forms
Working with Layers...(continued)
Demonstrate creating layers
� Create a layer on the Demo Form.
� To make it more visible, type some text into the layer.
� Show how a layer can be dragged anywhere on the form.
Show the layer anchor
� Show the layer anchor that was created when the layer was created.
� Demonstrate that moving a layer does not move the anchor.
318 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Layers...(continued)
Creating a layer
Follow these steps to create a layer on a form.
Step Action
1 Open a form, page, or subform in 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 surround the layer, indicating it is selected.
4 Click inside the layer and add the layer’s content.
5 Save and preview the form.
The layer anchor
Each layer has an anchor. The layer anchor associates itself with the element closest to where it was inserted, such as a paragraph of text. This is referred to as the parent element.
If the layer is moved, the anchor remains in place. To display or change the name of the layer, right-click the layer anchor. The Layer Anchor Properties box appears with the current name of the layer.
The following image shows a layer and its anchor.
Layer Anchor
Layer with selection handles
Student Guide Page No. 160 319
PreviewLesson 8 � Enhancing Forms
Working with Layers...(continued)
Show the Layer Properties box
Note that the name of the layer is contained in the HTML tab.
320 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Layers...(continued)
Layer properties
After you create a layer, you can change the following properties:
� Background color and image
� HTML properties
� Position
Layer background
The layer’s background color can be the system color, gray, transparent, black, or an RGB value.
The following table lists the color icon choices in the Layer properties box.
Icon Function
System color
Transparent
Black (0,0,0)
Red, Green, Blue (RGB)
Student Guide Page No. 161 321
PreviewLesson 8 � Enhancing Forms
Working with Layers...(continued)
Add a background color
� Create another layer on the Demo form.
� Change the name of the layer to BackgroundColor.
� Change the background color.
Add a background image
� Add an image from the image resources to the layer with a background color.
� Demonstrate the various display options, center, tiled vertically, etc.
322 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Layers...(continued)
Layer background images
Layers can contain a background image in addition to, or instead of, a background color. The image used for the layer background must be a shared image resource. Images can be displayed once in the layer, or tiled horizontally, vertically, or continuously.
Modifying the background of a layer
Follow these steps to modify a layer’s background.
Step Action
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 on the drop-down arrow to the right of Color.
5 Choose one of the color options: � System � Transparent � Black � RGB
6 Click on the folder, to the right of Images, to insert an image resource.
7 Select one of the image repeat values.
8 Save and preview the form.
Student Guide Page No. 162 323
PreviewLesson 8 � Enhancing Forms
Positioning Layers
Demonstrate resizing and repositioning a layer by dragging and dropping
Use the layers you have created on the Demo Form.
324 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Positioning Layers
A layer can be resized and repositioned several different ways:
� It can be dragged and dropped.
� Its position can be set explicitly.
� It can be positioned in relationship to other layers on the form.
Layer position values
The position of a layer on the screen, its size, and the position of the layer in relationship to other layers is displayed and/or modified in the Layer position tab of the Layer properties box.
When you drag and drop a layer, or resize it using the layer window handles, the Top, Left, Width, and Height parameters change to reflect the new position or size.These values can also be changed to set the size and position of a layer explicitly.
The z-index parameter determines the order in which the layer appears if there are multiple layers on the form, page, or subform. Think of the layers as stacked one upon the other. If there were three layers, the lowest layer would have a z-index of zero, the middle layer would have a z-index of one, and the top layerwould have a z-index of two. Other facts about the z-index parameter:
� 0 is the default.
� 1 appears above 0.
� Multiple layers can have the same level.
� Negative values are placed behind the parent element.
Student Guide Page No. 163 325
PreviewLesson 8 � Enhancing Forms
Positioning Layers...(continued)
Demonstrate setting layer coordinates
� Open the properties box for the background colored layer you created earlier.
� Set the Z-index to -1.
� Create a third layer with the system color and set its Z-Index to 1 to demonstrate the differences between a negative and positive Z index and zero.
Don’t worry if this third layer covers text, you’re just using it to demonstrate different layer properties.
Discuss the difference between the different coordinate value choices:
� Pixels
� Inches
� EM units
� A percentage of the distance from the parent element
� Auto
Work with multiple layers
� Demonstrate the multiple layer options listed on the student guide.
� Use the three layers you created earlier.
� Make sure to emphasize the flexibility and control this feature allows
326 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Positioning Layers...(continued)
Setting a layer’s coordinates
Follow these steps to modify the layer’s position properties.
Step Action
1 Select the layer.
2 Choose Layer Æ Layer Properties.
3 Click the Positioning tab.
4 Type in the appropriate coordinates to align the layer from the top or left edge of the parent element.
5 Type in the appropriate coordinates to change the layer’s height and width.
6 Type in the appropriate integer for the layer’s Z index.
7 Save and preview the form.
Working with multiple layers
There are different ways to align multiple layers.
The following table lists the tools for aligning multiple layers.
To Follow these steps
Select multiple layers � Select the first layer. � Press CTRL and click the other layer(s). Result: There will be selection handles around the 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.
Student Guide Page No. 164 327
PreviewLesson 8 � Enhancing Forms
Hiding Layers
Hide a layer using Hide/When
� Select the layer anchor of one of the layers that you created in the earlier demos.
� Choose TextÆText Properties. Note: Clarify that the hiding of a layer in this case has to do with text properties, and that you can hide a layer dynamically like other text and fields. This is as opposed to using the Layer Tree to hide a layer.
� Click the Hide/When tab and select to hide the layer from Notes R4.6 or later and web browsers.
� Save and preview the form in both the Notes Client and a web browser.
Hide a layer using the Layer Tree
Note that hiding a layer using the Layer Tree is useful when developing a form with multiple layers.
328 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Hiding Layers
The layer tree
Like other design elements, layers can be hidden using Hide/When properties. For ease of development, however, Designer provides another method for hiding layers.
The layer tree hides one or more layers for the current session. You can work on one layer without another layer, or layers, getting in the way. If a layer is hidden, a grey circle appears next to the name of the layer; otherwise, the circle is empty.
The following image shows a layer tree properties box with three hidden layers:
Note: When a hidden layer is selected, the top button in the properties box toggles from Hide to Show.
Hiding a layer
Follow these steps to hide a layer:
Step Action
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.
Student Guide Page No. 165 329
PreviewLesson 8 � Enhancing Forms
Work with Layers
Introduce the Guided Practice
In this Guided Practice, students will add a layer to the Employee Information form.
Allow 10 minutes for this Guided Practice.
330 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Work with Layers
Create a layer, add content and a background
In this Guided Practice you will add a layer with a background image for visual appeal. You will copy the form fields and labels into the layer.
Follow these steps to complete the Guided Practice.
Step Action Result
1 Open the Employee Information form.
The form appears in the Work pane.
2 Place the cursor below the other content on the form.
Select CreateÆ Layer.
A blank layer is added to the form.
3 Drag the layer handles so that the layer is approximately as large as the area of the field labels and fields on the form.
4 Highlight the fields and the label text. Press CTRL-X to cut the fields.
5 Place the cursor inside the layer. Press CTRL-V to copy the fields into the layer.
The fields appear inside the layer.
6 Resize and reposition the layer by dragging it so that it is under the form title.
The layer, along with its fields and text are repositioned.
7 Choose LayerÆLayer Properties. The layer properties box appears.
8 Click the Background tab.
9 Click the folder icon next to the Source dialog. Select lesson_menu_background.gif. Click OK.
The background image appears in the layer.
10 Select Repeat horizontally in the Repeat dialog.
The background image fills the layer.
11 Select the HTML tab.
12 Enter Image_and_Fields in the ID field.
13 Save and preview the form.
Student Guide Page No. 166 331
PreviewLesson 8 � Enhancing Forms
Working with Subforms
Introduce subforms
332 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Subforms
A subform is a collection of form elements stored as a separate design element. Subforms can be used in multiple forms in a database. A subform can contain anything a form can contain.
Benefits of subforms
The benefits of using subforms in your application include:
� Saving design time
� Ensuring design consistency
A form can contain one or more subforms. One subform can be used in many different forms within the same database or across different databases. Subforms can also be used conditionally depending on the results of a formula.
The following graphic shows one subform being used in multiple forms:
Student Guide Page No. 167 333
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Describe when to use subforms
Present the examples listed on the Student Guide and ask the students for more ideas of when to use subforms.
Discuss how subforms work
� Subforms can only be used as part of a form.
� Changes that are made to the subform affect all other forms that use the subform.
334 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
When to use subforms
Examples of when to use a subform include:
� To add a formatted logo or letterhead
� To ensure consistency and standards in form design
� To start building new forms quickly
How subforms work
Subforms can only be used as part of a form. Every time a document is created or opened the form references the subform. Elements of a subform automatically become part of the form when displaying documents. Changes made to a subform affect all forms and documents that include the subform.
Creating a subform
Creating and using a subform in a database is a two-part process:
� First, create the subform.
� Second, include the subform as part of a form.
Student Guide Page No. 168 335
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Discuss the subform properties box
Discuss the difference between the two display options:
� Include in Insert Subform dialog
� Include in New Form dialog
Also mention the do not add field na,es to index option and its purpose.
Create a subform
� Create a subform to be used as an address footer, for example:
123 Culpepper DriveMahoopney, IA 55623
� Name the subform subAddress.
� Leave the text on two lines, left justified.
336 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Creating a subform
Follow these steps to create a subform.
Step Action
1 Open the database in Designer.
2 Choose Shared Code in the Design list.
3 Select Subform 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 properties box
Note: The Include in Insert Subform dialog option is selected by default.
6 Name the new subform.
7 Add elements to the subform as you would a form.
8 Save and close the subform.
Subform properties
Like other design elements, subforms have properties you can set, using the Subform properties box. Use the Subform properties box to:
� Give the subform a name and an alias.
� Specify display options for the subform.
Student Guide Page No. 169 337
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Add a subform to a form
Add the subAddress form to the bottom of the Demo form.
To illustrate one of the advantages of subforms, do the following:
� Point out that the address is currently on two lines and left justified.
� Go back to the subAddress subform.
� Change the text to be all on one line and centered.
� Reopen the Demo form and show that the address format has changed.
338 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Including a subform in a form
Follow these steps to insert a subform in a form.
Step Action
1 Open a form in 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.
Computed subforms
You can have different subforms appear conditionally, depending on the result of a formula. This is called a computed subform. For example, you might offer users a choice of custom mail forms with different graphics and styles for various types of messages.
Student Guide Page No. 170 339
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Discuss computed subforms
340 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Checklist: Computed subforms
Complete the following tasks to implement computed subforms:
Step Action
� 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 include different subform headings in the same form, depending on whether a user is posing a question, replying to a question or adding a comment.
@If(MsgType=question;"QuestionSub"; MsgType="reply"; "ReplySub"; "CommentSub")
The value in the MsgType field determines which subform is used.
Student Guide Page No. 171 341
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Add a computed subform
Use the subNewDoc and subSavedDoc subforms. Use the following formula to compute which subForm appears on the Demo form:
@If(@IsNewDoc;"subNewDoc";"subSavedDoc");
342 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
PreviewLesson 8 � Enhancing Forms
Working with Subforms...(continued)
Including computed subforms in forms
Follow these steps to include a computed subform in a form.
Step Action
Open the form.
Click where you want to add the subform.
Choose CreateÆ ResourceÆInsert Subform.
Select Insert Subform based on formula.
Click OK.
Enter a formula in the Programmer's pane that determines which subform to display.
7 Save the form.
Student Guide Page No. 172 343
PreviewLesson 8 � Enhancing Forms
Working with Shared Fields
Introduce shared fields
Create a shared field
Create a shared keyword field that has the following characteristics:
� Name: Creator
� Type: Names, Computed
� Formula: @Username
344 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
PreviewLesson 8 � Enhancing Forms
Working with Shared Fields
You can define a field for use on more than one form. For example, many forms have a creation date field; you can define this field once and reuse it. When you define a field as a shared field, Designer displays the field with a dark border and adds the field name to a list of shared fields available for use in a database.
Benefits of shared fields
The benefits of using shared fields include:
� Maintaining consistent formulas throughout an application
� Providing single point maintenance for a given field
� Standardizing keyword lists
Creating a shared field
Follow these steps to create a shared field.
Step Action
Expand Shared Code in the Design pane. Click Fields.
Click New Shared Field.
Enter a name for the shared field.
Assign a field type and choose Editable or a computed option, if applicable.
Close the Properties box.
Close and save the shared field.
Student Guide Page No. 173 345
PreviewLesson 8 � Enhancing Forms
Working with Shared Fields...(continued)
Insert a shared field
Convert a single field to a shared field
Convert any single field to a shared field.
346 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Working with Shared Fields...(continued)
Inserting shared fields
Follow these steps to insert a shared field onto a form or subform.
Step Action
1 Open a form or subform and position the cursor where you want the field to appear.
2 Choose CreateÆInsert Shared Field. Result: The Insert Shared Field dialog box appears.
3 Select the shared field you want to use and click OK.
To select a shared field from another database, click the Database pull-down list, highlight a database, select a shared field in that database, and click OK.
Converting single to shared fields
Follow these steps to convert a single-use field to a shared field
Step Action
1 Open the form.
2 Click the field to be shared.
3 Choose DesignÆShare This Field.
Student Guide Page No. 174 347
PreviewLesson 8 � Enhancing Forms
Inheriting Information
Introduce inheritance
Inheritance is introduced before response documents so that the students do not get the mistaken idea that inheritance is dependent upon a parent/child document relationship.
348 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Inheriting Information
Designer allows you to create fields that inherit values from other fields. The source fields and target fields can be in separate documents or in the same document. Therefore, data can be entered or assigned once and reused as needed in multiple places.
For example, when an employee is first hired there are many forms that need to be completed that include the employee’s name, address, employee number, job title, etc. Using inheritance this information need only be entered once.
Domino provides for this sharing of information by providing a method for inheriting information from one document to another.
Benefits of inheritance
The ability to inherit information automatically from one document to another has 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 each document.
Student Guide Page No. 175 349
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
How it works
Make the point that inheritance is not dependent upon a parent/child or main/ response relationship between the documents.
350 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
How inheritance works
Fields can inherit values from fields in other documents in the same database or from fields on the same document.
The following diagram illustrates how one source document contains field data that can be inherited by multiple receiving documents.
Student Guide Page No. 176 351
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
Demonstrate how inheritance works
Instructor Action Important Information
From the Notes client, open the Demo\Views view.
To demonstrate how inheritance works, highlight a document in the view, and select Create ÆDemo\InheritedFields
The first and last name fields are populated. Point out that this is a simple example of how a form can inherit data from an existing document.
Note that inheritance is a one-time occurrence. The data in the documents are not linked based on the fact that one value was inherited from another document.
Demonstrate how to enable inheritance on a form
Instructor Action Important Information
Open the Demo\InheritedFields form in Designer.
Open the Form properties box and show the Defaults tab.
Point out the On Create options dealing with inheritance.
Open the properties box for the InheritFName field.
Point out that is a Computed when Composed field. In this case the field is text to match the field it is inheriting from.
Show the formula for the field in the Programmer’s pane.
Note that the formula is simply the name of the field being inherited.
352 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
Enabling inheritance
Forms can be designed to inherit information from an existing document. Fields can receive information from fields in other documents, or fields in the same document.
Creating a form to inherit values from another document requires that the developer:
� Enable the On Create: Formulas inherit values from selected document Form property.
� Create field(s) containing the following characteristics:
� Computed when composed field type
� Includes a formula that specifies the source field
Enabling inheritance on a form
Follow these steps to enable inheritance for a form.
Step Action
1 Create a form or open an existing form in 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 information.
4 Write a formula for the inheriting field(s) that evaluates to the source field name.
5 Save the form.
6 To test your work, highlight an existing document that contains the field(s) to inherit, then create a document with the new or revised form.
Tip: Fields that inherit information do not need the same field name as their source fields; they do, however, need to be the same data type.
Student Guide Page No. 177 353
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
Introduce the Guided Practice
Students will create a new form and use it to inherit information from the Employee Information documents.
Allow 15 minutes for this Guided Practice.
Note: This is a two-part Guided Practice.
354 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
Enable a form to use inheritance
In this Guided Practice you will create an Employee Benefits form that inherits an employee’s first and last name from documents created in the Working with Forms lesson.
Follow these steps to enable a form to inherit information from an existing document.
Step Action Result
1 Create a form and name it Employee Benefits with an alias of eb.
The form appears in the work pane.
2 Choose Design ÆForm Properties. Click the Defaults tab.
The Defaults tab of the Form Properties box appears.
3 Select On Create: Formulas inherit values from selected document. Close the properties box.
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
The InheritFName field is created.
5 In the Programmer’s pane for the InheritFName field: � Type the formula: FirstName
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
The InheritLName field is created.
(continued on next page...)
Student Guide Page No. 178 355
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
Introduce this portion of the Guided Practice
Allow the students 5-10 minutes with this Guided Practice.
356 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Inheriting Information...(continued)
Enable a form to use inheritance, continued
Follow these steps to enable a form to inherit information from an existing document.
Step Action Result
7 Create a rich text field named Comments.
8 Save your changes. You will test the form in the next Guided Practice.
9 Create an Employee Benefits view in order to see the new documents you will create.
Create documents that inherit information
Follow these steps to create a document that inherits information
Step Action Result
1 In the Notes client, open the Employees view. Select one of the employee documents that you created in Working with Forms.
2 Choose Create. Select Employee Benefits.
A new Employee Benefits form opens with the appropriate fields populated from the selected document.
4 Save the new document.
Student Guide Page No. 179 357
PreviewLesson 8 � Enhancing Forms
Creating Related Forms
Introduce the topic
Give several everyday examples of a response hierarchy--email, threaded discussions in a newsgroup, a message board, etc.
Have students talk about how and why these types of documents need to be related, what benefit is there to having them set in a hierarchical fashion?
358 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Creating Related Forms
In almost every application there is a need to create information that is related to other information. A typical example of this is a question and answer structure. Another very familiar example is a discussion forum.
Form types
Domino provides for this type of main/response structure, sometimes referred to as a response hierarchy, by letting the developer designate a form’s type.
The following table lists the three Domino form types and how they are used.
Form Type Description
Document This document type is the default for Domino forms. It is used to create the top level in a hierarchy of documents. These documents are sometimes referred to as main or parent documents.
Response Creates response documents associated with a main document. Response documents are sometimes referred to as response or child documents.
Response-to-response Creates response documents associated with either a main document or a response document.
Student Guide Page No. 180 359
PreviewLesson 8 � Enhancing Forms
Creating Related Forms...(continued)
Explain the response hierarchy diagram
As you talk about the diagram keep in mind that you are talking about the relationship of the documents to each other. The students will learn about showing response documents in a view in the next lesson.
360 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Creating Related Forms...(continued)
The response hierarchy
The following diagram illustrates the relationship between main documents, response documents and response to response documents.
Student Guide Page No. 181 361
PreviewLesson 8 � Enhancing Forms
Creating Related Forms...(continued)
Show the form response type property
Open the Demo Form and show the form type property.
Discuss the differences between the Response type and Response to Response. Include an example of where you might use each response type.
For example,
� Imagine a company which makes and sells a product.
� Document - Details of the product (the product specification).
� Response - An order for the product (You can't order something we don't sell!)
� Response to Response - Customer comments based on either the product ("Why don't you make them in blue?" "Why don't you sell them in boxes of 100?") or orders which have been placed ("Arrived two days late!" "Great service! Thank you!")
362 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Creating a Related Forms...(continued)
Designating a form as a response
By default the Domino form type is set as Document. To designate that a form is a response or a response to a response, change the Form Type property.
The following image shows the Form Type property.
Creating a response form
Follow these steps to create a response form.
Step Action
1 Create a form or open an existing form in 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 other
responses.
4 Save the form.
Student Guide Page No. 182 363
PreviewLesson 8 � Enhancing Forms
Creating Related Forms...(continued)
Explain how the relationship between main and response documents is established
Discuss how inheritance is used with related documents
Again make the point that there does not need to be a main/response document relationship for inheritance to work.
Explain the different ways to inherit the contents of a main document to a response
Create a response form
� Create a new form. For the sake of clarity, name it Response to Demo. Have it inherit a couple of fields from Demo documents.
� Open a Demo document and create a Response to Demo. Do this several times as you will use these documents when you demonstrate creating a hierarchical view.
364 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Creating Related Forms...(continued)
Establishing the relationship between documents
To properly establish the relationship between a main document and a response document, you must have the main document selected in a view or opened when the response is created.
Inheritance and related documents
Inheritance is frequently used to transfer information between main and response documents. For instance, in a discussion application you would typically repeat the subject of the main document in the response.
As with document to document inheritance, the main document must be selected or open when a response is created for inheritance to work correctly.
Making a thread easier to follow
When developers design any type of main document/response document application, sometimes referred to as a threaded discussion, it is good practice to consider how users keep track of the information in the main document. Using Domino form properties, the developer can design the 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 generally the preferred method.
Student Guide Page No. 183 365
PreviewLesson 8 � Enhancing Forms
Creating Related Forms...(continued)
Introduce the Guided Practice
Students will add a link from the Employee Benefits form to the Employee Information form.
Allow 5 minutes for this Guided Practice.
366 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Creating Related Forms...(continued)
Add a link to a main document
In this Guided Practice you will make the Employee Benefits form a response form and include a link to the parent document.
Step Action Result
1 Open the Employee Benefits form in Domino Designer.
The form appears in the Work pane.
2 Create a field with the following characteristics: � Name: ParentDoc � Field type: Rich Text
The new field is created.
3 Choose DesignÆForm Properties.
The Form properties box opens.
4 Click the Defaults tab. Select On Create: Inherit entire selected document into rich text field.
You will see the following choices:
5 Select the ParentDoc field from the drop down list. Select Link.
The form properties are set.
6 On the Form Info tab, select Response as the form type.
7 Save the form.
8 To test your changes, select a document in the Employees view and create an Employee Benefits document. Note that there is now a link to the parent document.
Student Guide Page No. 184 367
PreviewLesson 8 � Enhancing Forms
Exercise: Create Question and Answer Forms in the Policies Database
Present the review questions
� What are layers and what are the benefits of using them?
� What is a subform, what the benefits of using one. When would you use a subform?
� What is a shared field? What are the benefits of using a shared field?
� What is inheritance and how does it work?
� What does the developer need to do to allow one document to inherit a value from another document?
� How do you create related forms? How does the user establish a main document/response document relationship when creating a response document?
� Is inheritance dependent upon a relationship between documents?
� What things can you do to make a discussion thread easier to follow?
Introduce the exercise
In this exercise the students will create the Question and Answer forms. In the next lesson they will create a view to display Question and Answer documents correctly.
Show the students what the finished forms might look like so they get some ideas. Suggest that they read the entire exercise before they begin.
Allow 30 - 45 minutes for this exercise.
Note: This exercises spans two student guide pages.
368 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Exercise: Create Question and Answer Forms in the Policies Database
The Worldwide Corporation wants to make it easier for employees to ask questions and receive answers about company policies. In this exercise you will create Question and Answer forms. The Answer form needs to inherit information from the Question form.
Both forms should have a consistent look and feel.
This exercise has the following parts:
� Use a layer and the mod_menu_background.gif file to enhance the look of the forms.
� Create a subForm that can be used to provide a consistent header to both forms.
� Design and create the Question form.
� Design and create the Answer form.
In the next lesson you will create a view to display the question and answer documents correctly.
Guidelines for the Question form
The Question form needs to gather certain information. The table below describes the information to be gathered and lists suggested field names 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 question falls into. The categories are: � Office Guidelines � Benefits � Holidays � Grievance Procedure
Hint: Is there a shared field that you might use?
Category, Dialog List with the following choices
The subject of the question. Subject, Text.
The question. Question, Rich text
The date the question was created. QuestionDate, Date-time
Student Guide Page No. 185 369
PreviewLesson 8 � Enhancing Forms
Exercise: Create Question and Answer Forms in the Policies Database...(continued)
370 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 8 � Enhancing Forms
Exercise: Create Question and Answer Forms in the Policies Database...(continued)
Guidelines for the Answer form
The Answer form needs to be designed so that it is a functional form for creating an answer (response) to the questions posed using the Question form. Think about the kinds of information that would be helpful. For instance, would it be helpful to have the subject of the question on the answer form? How about a link to the question?
Also, the Answer form should have a similar look and feel as the Question form. Use the same colors and graphics used in the Question form.
The following table lists suggested information to gather along with suggested field names and types.
Information to be gathered Suggested Field Name and Type
The subject of the question QuestionSubject, Text
The date the answer was created AnswerDate, Date-Time
A link to the question QuestionLink, Rich text
The answer Answer, Rich text
The date the answer was created. AnswerDate
Create several questions and associated answers.
Challenge
Use tables to create a more pleasing, balanced look and feel for the fields and field labels.
Apply any subForm you create in this exercise to the Policy form as well.
Student Guide Page No. 186 371
PreviewLesson 9 � Enhancing Views
Enhancing Views
Introduce the lesson
372 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
9
PreviewLesson 9 � Enhancing Views
9 Enhancing Views
This lesson includes more tools for creating more efficient, easier to read views.
Objectives
After completing this lesson you should be able to:
9 Write a view selection formula.
9 Concatenate values in a view column.
9 Display response documents in a view.
Student Guide Page No. 187 373
PreviewLesson 9 � Enhancing Views
Writing View Selection Formulas
Explain how to include specific documents in a view
The conditions that students created with Search Builder in Module B served as a document selection shortcut. View selection formulas give the developer tighter control, and work more efficiently.
The diagram on the student page was used in Module B. It is used again here for illustration purposes.
374 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Writing View Selection Formulas
Views can include all documents in a database or a subset of those documents. The selection condition, whether it is created with Search Builder or a View Selection Formula, controls the document displayed. All documents that match the selection criteria are displayed in the view.
In Working with Views, you used simple conditions to select which documents to display in a view. View selection formulas, however, provide more control over which documents a view displays.
Including documents in a view
The following graphic illustrates the view selection process.
Student Guide Page No. 188 375
PreviewLesson 10 � Enhancing Views
Writing View Selection Formulas... (continued)
Describe the parts of a view selection formula
� Condition formula
� SELECT keyword
Provide other examples of view selection formulas
Show an example of a view selection formula
� Open the Date Hired view to show a view with a selection formula.
� Show where the formula is entered in the Programmer’s pane.
376 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Writing View Selection Formulas... (continued)
The view selection formula
When a view is first created the default selection formula is SELECT@All. Using this formula, all documents in the database are included in the view. In Working with Views, the Simple Search selection builder was used to create more specific views. However, using the SELECT statement allows greater control of the selection of documents.
The view selection formula syntax is as follows:
SELECT Condition formula;
The following table describes the parts of a view selection formula.
Part Function
SELECT keyword Includes a document based on the result of the comparison formula.
Condition formula A formula that evaluates to either True (1) or False (0). It can use constants, fields, operators, and @Functions.
Examples of view selection formulas
The following table describes a few examples of view selection formulas.
This View Selection Formula... Includes All Documents That...
SELECT @All Are in the database. This is the default formula for view selection.
SELECT Form = “ei” Were created using a form with the name or alias ei.
Select (Price < 1000) & (InStock = “Yes”)
Contain a field called Price whose value is less than 1000 and a field called Instock whose value is Yes.
SELECT Form = “ei” & Department != “Accounting”
Were created using the form named ei and contain a field named Department whose value is not equal to Accounting.
Student Guide Page No. 189 377
PreviewLesson 10 � Enhancing Views
Writing View Selection Formulas...(continued)
Introduce the Guided Practice
� The Guided Practice asks students to build a view based on the Employee Info view they created earlier.
� The new view includes only employees whose salaries are greater than $30,000.
� Allow 10 minutes for this Guided Practice.
378 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Writing View Selection Formulas...(continued)
Write a view selection formula
In this Guided Practice you will create a view selection formula that selects documents of employees whose salaries are over $30,000.
Follow these steps to complete the Guided Practice.
Step Action Result
1 Open the Practice.nsf database. Click Views in the Design Elements list.
A list of views appears in the Work pane.
2 Create a view based on the Employee Info view. Name the view Salaries.
The view is created and appears in the Design list.
3 Open the view. The view appears in the Work pane.
4 Select View Selection in the Objects pane.
5 In the Programmer’s pane, select Formula in the Run dropdown list.
SELECT @All appears in the Programmer’s pane.
6 Delete the selection formula. Enter the following formula: SELECT Form="ei" & Salary>30000
The new formula is created.
7 Save the view. Preview your work in the Notes Client.
Student Guide Page No. 190 379
PreviewLesson 10 � Enhancing Views
Concatenating Values in a View Column
Explain how to display multiple values in a single view column
To display multiple values in a view column, you must:
� Use conversion functions to make the values the same data type.
� Concatenate the values with operators or functions.
Demonstrate converting values to text
� Open the Date Hired view.
� Select the Date Hired column.
� Choose Formula in the Programmer’s pane and type the following formula:
@Text(DateHired; “S0D2”);
� Explain what S0D2 does to the value.
� Refresh the view.
380 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Concatenating Values in a View Column
Concatenating text values, or strings, is useful when you want to combine related fields in a single column or when the field value requires supporting text to make sense to users.
The + sign is used to concatenate text into a single string. For example, the following view column formula displays the first name and last name with a space between them in a single column.
FirstName + “ “ + LastName
You can only concatenate text values. To include other data types in your concatenation, do the following:
� Convert, also known as normalize, the values to text.
� Concatenate the text values.
Converting values to text
To combine different types of values, you must first make sure that the values are the same data type. For example, to display number and text values in a view column, convert the number to text, then concatenate the text values.
Use @Text to convert number and date-time values to text. @Text offers options to control the format of the resulting text.
The syntax for @Text is as follows:
@Text( value ; "format-string" );
Where:
� Value can be a number, time-date, rich text.
� Format-string is optional. It controls the formatting of the returned text value. For example, if a currency value is converted to text, you might want the new value displayed with the appropriate currency symbols and punctuation.
Student Guide Page No. 191 381
PreviewLesson 10 � Enhancing Views
Concatenating Values in a View Column...(continued)
Using @Text
Have the students open Designer Help for @Text and look at the Examples. This has a more complete listing of the @Text format-string components.
Demo how to concatenate multiple values in a view column
382 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Concatenating Values in a View Column...(continued)
Using @Text
There are two types of format string components available for text values: date-time components and numeric value components. These components can be combined in various ways. Listed here are several of the more commonly used string components and what they display:
� D0 - year, month, day
� D2 - month and day
� S1 - Time only
� C - Current
The following table provides some examples of converting values to text.
Original value Formula Result
The Sales field contains the value 800.
@Text(Sales; "C,2") $800.00
The Date field contains 12/31/99 11:59:59 PM.
@Text(Date; "S0D2") 12/31
The Date field contains 12/31/99 11:59:59 PM.
@Text(Date; "S1T0") 11:59:59 PM.
Creating a formula that concatenates multiple values in a view column
Follow these steps to enter a column formula that concatenates multiple values.
Step Action
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.
Student Guide Page No. 192 383
PreviewLesson 10 � Enhancing Views
Concatenating Values in a View Column...(continued)
Introduce the Guided Practice
384 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Concatenating Values in a View Column... (continued)
Concatenating text and number values
In this Guided Practice you will create a view that quickly shows a list of employees and their date of hire.
Follow these steps to complete the Guided Practice.
Step Action Result
1 Create a view in the Practice database called Date of Hire.
The view appears in the Work pane.
2 Select the default column. Delete the column header.
The default column header is deleted.
3 In the Script area for the column, click the Formula button.
4 Replace the default formula with: FirstName+ “ “ + LastName " was hired on “ + @Text(DateHired; "S0D1");
Employees’ first names and hire date will appear. If the employee was hired this year, only the day and month will display.
5 Sort the column in ascending order.
6 In the Selection Formula object, enter the following formula: SELECT Form=”ei”
The view will only display documents created with the Employee Information form.
7 Save and preview the view.
Student Guide Page No. 193 385
PreviewLesson 10 � Enhancing Views
Creating a Hierarchical View
Present the process of creating a hierarchical view
Open the Hierarchical View Demo Page contained in the Instructor database. The page contains a table that you can use to present the process of creating a hierarchical view.
Notes for the Instructor: Make sure you study this page before presenting the information to the students. There is explanatory text in the cells of the table that you need to be very familiar with prior to doing this in the classroom.
386 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
PreviewLesson 10 � Enhancing Views
Creating a Hierarchical view
In Enhancing Forms you created Question and Answer forms. Unless you design a view to display this document hierarchy, the documents are not easy to find and their relationship is not necessarily apparent.
A hierarchical view is a view that displays main documents and their associated response documents, and visually distinguishes between them. Each main document has its response documents indented under it.
Displaying response documents beneath main documents helps to view the progression of a discussion. Each level is indented three spaces under its parent document.
Displaying documents in a hierarchy
Follow these steps to display main documents and response documents in a hierarchy.
Step Action
Create a view
Write an appropriate selection formula
Set the Show response documents in a hierarchy View property.
Create columns to display the data
Create a responses only column for displaying the response documents
Save and test the form.
Student Guide Page No. 194 387
PreviewLesson 10 � Enhancing Views
Displaying Response Data in the View
Displaying response data
Create a simple view that displays documents and response documents. Base the view on the Demo and Response to Demo documents.
Note: Do not create the responses only column yet. You will do that on the next page.
388 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Displaying Response Data in the view
View columns are structured to display data from fields in the main document. The view displays little, if any, data from response documents.
If the response form happens to contain fields with the same names as those specified in the column formulas, that data will appear in the view. Otherwise, the rows representing responses show no meaningful data.
To specify information to be displayed about each response document, use a responses-only column.
Using a responses only column
A responses-only column displays data from a document only if that document is a response or response to response document.
The responses-only column should be positioned to the left of the column under which you want it to indent. The data displayed for a responses-only column starts just to the right of where you position it in the row, and extends to take up the entire row.
Note the following about placement of columns:
� Columns to the left of the responses-only column, such as a date, will display response data (if available in the document) in the row.
� Columns to the right of the responses-only column do not appear for response documents; the contents of the responses-only column appear instead.
Student Guide Page No. 195 389
PreviewLesson 10 � Enhancing Views
Displaying Response Data in the View...(continued)
Demonstrate creating a responses only column
� Add the responses only column to the view you just created.
� Add a formula to the responses only column to display some data from the response documents.
390 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Displaying Response Data in the View...(continued)
Selecting multiple forms to display in a view
To this point the views you have worked with display data using only one form. When using more than one form in a view, the view selection formula must be written to select both of them. The following code is an example of a view formula that uses two forms, Main and Response:
SELECT (Form = "Main") | (Form = "Response”)
The code could also be written as:
SELECT Form = "Main" | @AllDescendants
Creating a responses only column
Follow these steps to add a responses-only column to a view.
Step Action
1 Open the view in Designer.
2 Create a new column to the left of the column under which responses will 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 response documents in the column, such as subject, authors, and creation dates.
5 Save the view.
6 Test the view by previewing it in Notes.
Example of a formula used in a responses only column
Typically 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)
Student Guide Page No. 196 391
PreviewLesson 10 � Enhancing Views
Exercise: Display the Question and Answer Documents in a View
Introduce the exercise
In preparation for this exercise, do the following:
� On the white board, draw a form that represents the Question form. Include the fields.
� Do the same for the Answer form.
� Ask the students how they would set up the view:
� What would the selection formula be?
� What data would they show from the Question documents?
� What data would they show from the Answer documents?
� How would the data in the view be presented? (sorted? categorized?)
Allow 30 minutes for the following exercise.
392 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Enhancing Views
Exercise: Display the Question and Answer Documents in a View
Now that you have created Question and Answer forms for creating Q&A documents about Worldwide’s policies, you need to create a view that shows the questions with their corresponding answers in a hierarchical view.
In the following exercise you will create a hierarchical view that displays the question and answer documents.
Note: Make sure you do this work in your Policies database.
Tasks
� Create a view that displays the subject field of the question document, and the date the question was created.
� Show the subject of the answer document, along with the date the answer was created, in a single column.
� Display the questions by category.
Student Guide Page No. 197 393
PreviewLesson 10 � Enhancing Views
394 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
E Automating Tasks Lesson 10 Using Actions to Automate Tasks
Lesson 11 Using an Agent to Update Documents
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewLesson 10 � Using Actions to Automate Tasks
Using Actions to Automate Tasks
Introduce the lesson
Automation can be activated by users or by the application itself. This module concentrates on user-activated automation using:
� Actions
� Agents
396 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
10
PreviewLesson 10 � Using Actions to Automate Tasks
Using Actions to Automate Tasks
Actions make it possible for you to set up user-activated shortcuts in forms and views to perform routine tasks. You make the action available in the actions menu or as a button in the action bar.
In this lesson, you will learn how to use actions to automate common user tasks.
Objectives
After completing this lesson, you should be able to:
9 Create form and view actions.
9 Create shared actions.
9 Format how actions are displayed.
9 Create sub-actions.
9 Create action hotspots.
Student Guide Page No. 200 397
10
PreviewLesson 10 � Using Actions to Automate Tasks
Defining Actions
Provide examples of using actions
Create an Edit Info action
� Open the Demo form in Designer.
� Create an Edit Info form action.
� Open one of the documents created with the Demo form.
� Click the Edit Info button.
398 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Defining Actions
An action is a program associated with either a view or form and used to automate tasks for users. Actions are added to applications in order to:
� Speed up repetitive tasks.
� Update information.
� Simplify the usage of the database.
� Perform complex calculations.
� Check for errors.
Examples of actions
You can use an action to:
� Recreate Notes menu commands as buttons. For example:
� Create a document
� Edit a document
� Save a document
� Mail the current document.
� Move user selected documents in a view.
� Calculate complex formulas that don’t need to be saved with individual documents.
Checklist: Designing actions
Before creating an action, you should consider the following checklist:
Task Procedure
� 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.
Student Guide Page No. 201 399
PreviewLesson 10 � Using Actions to Automate Tasks
Defining Actions...(continued)
Describe how to program actions
Briefly list the Action coding options from the Student Guide.
Explain where actions appear to users
The Action bar is discussed in more detail at the end of this lesson.
Explain when actions appear to users
� Open the Edit Info Action Properties box and select the Hide/When tab.
� Show that the options selected so that the Action does not appear when the document is in Edit mode, but does appear when the document is in Read mode.
400 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Defining Actions...(continued)
Programming options available in actions
Like other design elements, you can program actions using one of the following options:
� Simple actions
� Formulas
� LotusScript
� JavaScript
Note: Simple actions can’t be customized and are not supported in Web applications.
Where actions appear to users
Actions in a view are available to users when the view is opened. Actions in a form are available when a document created with the form is displayed.
Users access actions either from:
� The Notes actions menu command
� An action bar button
The Action Bar is a row of buttons across the top of a form or view. To execute an action from the action bar, users simply click the button.
When actions appear to users
You can conditionally restrict the availability of an action using the action’s Hide/ When properties. These are the same Hide/When properties available to other design elements. Use these properties to make an action visible when it is relevant.
For example:
� Hide an action that edits a document when the document is in Edit mode.
� Hide an action that saves a document when the document is in Read mode.
Student Guide Page No. 202 401
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions
Describe the Action pane
Show students two ways to manually open the action pane:
� By sliding it open.
� By using the menu option. ViewÆAction pane.
402 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions
Once you have designed your action, you can create it on the appropriate form or view.
The Action pane
The Action pane displays the actions available to a particular form or view. You can select an action from the action pane in order to open, edit or delete the action.
The following graphic shows the Action pane for a form.
Action pane
Student Guide Page No. 203 403
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Describe the Action Properties box
� Describe the difference between the action name and label.
� Describe the display options.
� Describe the icon options.
404 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
The Action Properties box
Like other Designer features, actions are modified using its properties box.
The following graphic shows the Action Properties box.
Action Hide/ When
Basics Tab
Where action appears
Choose icon style and location
Student Guide Page No. 204 405
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Introduce the Guided Practice
Allow 5 minutes for this Guided Practice.
406 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Create an edit action
In this Guided Practice you will create a button on the Employee Information form that will allow users to edit documents.
Follow these steps to complete the Guided Practice:
Step Action
1 Open the Employee Information form in Designer.
2 Choose CreateÆActionÆAction from the menu.
3 In the Action Properties box, name the action Edit Employee Info.
4 Select the following display options: � Type: Button � Include action in Action Bar � Include action in Action menu
5 Ensure that Client and Formula are the defaults in the Programmer’s Pane.
6 In the Script area of the Programmer’s pane enter the formula: @Command([EditDocument])
7 Save the form and test the action on an existing document.
Student Guide Page No. 205 407
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Explain system actions in Notes
You can’t change the "System actions" functionality, but you can customize their appearance in the action bar.
408 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
System actions
By default, new forms and views do not contain actions. Designer provides a set of pre-defined system actions for common tasks. System actions can be added to a form or view.
The following is a list of Domino system actions:
� Categorize
� Edit Document
� Send Document
� Forward
� Move to Folder
� Remove from Folder
System actions can not be modified; individual actions can be removed if they aren’t needed.
System actions do not translate to Web applications. You can create your own actions to perform the same functions using the Formula language instead.
Student Guide Page No. 206 409
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Demonstrate inserting system actions
Add system actions to any existing form or view.
Show references for @commands
Instructor Action Important Point
Show students that they can open Designer Help or use the Reference tab to get more information on @Commands.
@Command ([Compose]) may not be intuitive to the students. Explain that compose is a historical term from the early days of Lotus.
Note: If the user’s notes.ini file includes the following statement, the @Command formula will not execute:
NoExternalApps=1
410 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Inserting system actions
Follow these steps to insert system actions onto a form or view.
Step Action
1 Open the form or view in Designer.
2 Choose CreateÆActionÆInsert System Actions. Result: The system actions are added to the Action pane.
3 Save the form or view.
Formula language commands that simulate Notes menu commands
@Commands are special functions that simulate the functionality of Notes menu commands. For example, use @Command ([Compose]) to create a button that creates a new document based on a specific form.
The syntax for using @commands is:
@Command([command];parameters);
Student Guide Page No. 207 411
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Discuss order of evaluation for @commands
The order of formula evaluation was discussed in Module C. However, there are several @commands that are an exception to the general rule. Direct students to help if they want the specific @command functions that are evaluated as encountered or after all @functions are executed.
For example, the following is an abbreviated list of @command functions that are evaluated as encountered or immediately.
Evaluated after all @functions Evaluated immediately
EditClear Clear
EditProfile EditProfileDocument
FileCloseWindow CloseWindow
FileExit ExitNotes
ViewChange SwitchView
412 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Working with Actions...(continued)
Commonly used @commands
The following table contains examples of commonly used @commands.
@Command Function Example
Compose Creates a new document with the specified form.
@Command ([Compose]; “Response”)
FileSave Saves the current document.
@Command ([FileSave])
FileCloseWindow Closes the current window.
@Command ([FileCloseWindow])
EditDocument Opens the currently selected document for editing.
@Command ([EditDocument])
Caution
To Web-enable all action buttons in a database as well as certain @commands, select the database property "Web access: Use JavaScript when generating pages." Without this property set, Domino recognizes only the first button in a document and treats it by default as a Submit button that closes and saves the document.
Order of evaluation for @commands
Domino evaluates formulas from top to bottom and left to right, completing each statement before proceeding to the next. @Commands are evaluated in one of two ways: as encountered or after all @functions. In most cases the @command runs in the order specified in the formula.
Student Guide Page No. 208 413
PreviewLesson 10 � Using Actions to Automate Tasks
Shared Actions
Review the concept of shared resources
� Display and review the types of shared code in the Design pane.
� Review the benefits of using shared resources.
Create a shared action
Instructor Action Important Information
In the Instructor database, demonstrate how to create a shared action that creates a new document. Create a shared action that creates a new Demo document.
Describe the similarity between creating a shared action and creating an action in a form or view. Also note that this action is available to all forms and views in the database.
In the next demo you will insert this action.
Explain how to set shared action properties
Properties cannot be changed when you insert the action in a view or form. However, the position of the action can be changed. Changes must be made to the shared action under shared code/actions, not in the view or form where it was inserted.
414 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Shared Actions
Shared actions are actions that you create as resources for the entire database. Once you create a shared action you can insert it in multiple views and forms. If you need to modify the action, the modification will take effect in every form or view that refers to it.
Creating a shared action
Follow these steps to create a shared action.
Step Action
1 Open the database in Designer.
2 In the Design pane, click Shared Code. Then, click Actions.
3 Click New Shared Action. Result: The Shared Action Properties box opens.
4 Create the shared action as you would any action.
5 Save the shared action.
Setting shared action properties
A shared action has the same properties as a standard action. You set the properties when you create the shared action. These properties determine how the action will behave in every form or view that uses it. The only property you can change on each form or view is the action’s position on the action bar.
Student Guide Page No. 209 415
PreviewLesson 10 � Using Actions to Automate Tasks
Shared Actions...(continued)
Insert a shared action on a form or view
In the Instructor database, insert the shared action in the:
� Demo view
� Demo form (hide when editing)
416 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Shared Actions... (continued)
Inserting a shared action on a form or view
Follow these steps to insert a shared action on a form or view.
Step Action
1 In Designer, open the form or view where you want to use the shared action.
2 If you are designing a view, choose CreateÆInsert Shared Action from the menu.
If you are designing a form, choose CreateÆActionÆInsert Shared Action
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.
Student Guide Page No. 210 417
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display
Demonstrate adding sub actions to a form or view
Instructor Action Important Information
In the instructor database create subactions on the Demo form.
For example, group a FileCloseWindow action and a FileSave action together under a single action heading, such as, Document Options.
Show results in the Notes client
Use these actions to demonstrate action bar properties and the action bar applet in the following sections.
418 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display
There are a couple of ways to enhance the display of actions. This section examines how to:
� Create actions with sub actions.
� Customize the action button bar.
Sub actions
Sub actions group related actions under a single main menu choice or button.
Use sub actions if you have:
� A long list of actions and do not want to overwhelm users
� Related actions that you want to group together
Adding sub actions to a form or view
Follow these steps to add subactions to a form or view.
Step Action
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 sub action. To name this action placeholder, open its properties box.
3 Type a name for the sub action.
4 Program the sub action.
5 Save and preview the form or view.
6 To add more subactions, select the placeholder then choose CreateÆAction.
Student Guide Page No. 211 419
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Demonstrate rearranging the order of form or view actions
� Open a form or view with actions.
� Rearrange the actions by dragging and dropping them.
Demonstrate hiding action buttons
420 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Rearranging action order
Actions and sub actions appear in the order they were created. You can rearrange this order in a more logical sequence.
Follow these steps to rearrange the order of actions and subactions.
Step Action
1 Open the form or view with actions in 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 action buttons
Like other form or view elements, actions and action buttons can be hidden under certain conditions.
Follow these steps to hide an action or action button.
Step Action
Open the form or view.
Select the action.
Choose DesignÆ Action Properties.
Click the Action Hide When tab.
Select the appropriate options.
Save and preview the form or view.
Student Guide Page No. 212 421
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Emphasize the following points regarding action bars
� When users scroll the form or view, the action bar remains at the top of the screen.
� Domino provides an applet that displays a fully functioning action bar to Web users.
� The action bar applet is not completely functional on web. Some formatting is lost.
422 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Customizing the action bar
The action bar displays action buttons at the top of a form or view. Domino gives you the option of changing some of the action bar’s properties.
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 Domino action bar applet for Web users.
Actions that appear on the button bar use the Action Bar Properties box to set additional characteristics, such as font, color, and button size.
Student Guide Page No. 213 423
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Change the action bar
In the Instructor database:
� Demonstrate how to change the size and colors of the action bar on the Demo form.
� Show results in Notes.
Note: You will continue to modify the action bar in the next demo (Enable the action bar applet demo).
Transition to action bar applets
The action bar in the Web browser does not look as good as it does in Notes. Choose the Using Java Applet option.
424 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Changing action bar properties
Follow these steps to enhance the look of an action bar.
Step Action
1 Open the form or view in 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 In the Action Bar Info tab: � Select the button bar alignment. � Select to display the button bar for Web users.
5 In the Action Bar Size tab: � Select the button bar size.
6 In the Action Bar Background tab: � Select the button bas background color. � Select the button bar background image and how it is displayed.
7 In the Action Bar Borders tab: � Select the button bar border style and effect.
8 In 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.
9 In the Button Font tab: � Select the font properties for all buttons on the Action bar.
10 Close the Action Bar Properties box.
Student Guide Page No. 214 425
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Enable the action bar applet
In the Instructor database:
� Demonstrate the Display Using Java Applet for the action bar on the Demo form.
� Show the results on the Web.
426 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Controlling How Actions Display...(continued)
Using the action bar applet
In the Action Bar Properties box, you can use a Java applet for Web access. The Java applet:
� Provides a scroll bar, when needed.
� Looks like the action bar in the Notes client.
� Supports cascading actions. When the user clicks the main action, the action selections appear as a second row of slightly smaller buttons.
Enabling the action bar applet
Follow these steps to enable the action bar as an applet.
Step Action
1 Open the Action Bar Properties box.
2 In the Basics tab, select Using Java Applet under Web Access Display.
3 Close the Action Bar Properties box.
Student Guide Page No. 215 427
PreviewLesson 10 � Using Actions to Automate Tasks
Action Hotspots
Introduce action hotspots . In addition to action hotspots the other hotspot types are:
� Link
� Text pop-up
� Button
� Formula pop-up
Demonstrate creating an action hotspot
Instructor Action Important Information
Open the Demo form in the instructor database.
Select an existing image or create a new one. Create an action hotspot with the following formula: @Prompt([Ok];"OK";"This action is done with Formula language")
Create a second action hotspot using the following JavaScript code: window.alert("This action is done with JavaScript!");
You must click and drag to select the image, if you just select it you will not be able to create an action hotspot.
Create a new document using the Demo form.
Click the action hotspot(s) you just created.
428 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Action Hotspots
Action hotspots are programmable areas on a form, subform or page that can complete an automated task.
Hotspots can be associated with:
� Text
� Graphics
Creating an action hotspot
Follow these steps to create an action hotspot.
Step Action
1 Open a form, subform or page.
2 Click and drag to select the text or image to be associated with a hotspot.
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 Client from the drop down list.
5 Select a programming language from the code drop down list.
6 Type the code in the Programmer’s pane.
7 Save and preview the form, subform or page.
Student Guide Page No. 216 429
PreviewLesson 10 � Using Actions to Automate Tasks
Exercise: Adding Automation to the Policies Application
Present the review questions
� How would you use actions and where?
� What programmatic feature can you use in an action to simulate some Notes menu options?
� When would you use sub-actions?
Introduce the exercise
Allow 20 to 30 minutes for this exercise.
The exercise has students creating shared action buttons to create new documents, save and edit existing documents.
The following table describes the actions and their implementation:
Action Where used
Create Policy Policies View
Edit Policy Policies View When policy document is open in read mode.
Create Question Q&A View Policies View
Edit Question Q&A View When question document is open in read mode.
Create Answer Q&A View When question document is open in read mode.
Edit Answer Q&A View When answer document is open in read mode.
430 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 10 � Using Actions to Automate Tasks
Exercise: Adding Automation to the Policies Application
Worldwide Corporation would like to automate creating and editing documents in the Policies application. Users should be able to:
� Create a policy or a question from the Policies view.
� Edit a policy when the document is open.
� Create a question or an answer from the Q&A view.
� Edit a question or an answer either when a document is open or selected in the Q&A view.
� Save any of the documents by clicking a button instead of using menu commands.
Tasks
� Make a list of actions you need to create and where they are to be used.
� Determine which of them could be shared.
� Create the actions and add to the appropriate views and forms.
� Hide the actions at the appropriate times. For instance, if a document is in edit mode there is no reason for the Edit action to be available.
Student Guide Page No. 217 431
PreviewLesson 11 � Using an Agent to Update Documents
Using an Agent to Update Documents
Introduce the lesson
432 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
11
Preview
11Lesson 11 � Using an Agent to Update Documents
Using an Agent to Update Documents
Agents are programs that perform a series of automated tasks. Use agents to set up user-activated or background tasks that run on a schedule. You can use agents to run automated tasks for views, documents, fields, and databases.
In this lesson, you will create an agent that updates existing documents.
Objectives
After completing this lesson, you should be able to:
9 Define an agent and describe its benefits.
9 Create an agent that modifies data in existing documents.
Student Guide Page No. 218 433
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents
Explain the following:
� The benefits of using agents
� The differences between actions and agents.
434 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents
Agents are programs within a Domino application. The benefits of using agents include:
� Agents can run manually by users or automatically in the background as scheduled agents.
� Agents are not associated with a specific design element.
� Agents can be run on a specific server, on several servers, on workstations, or the Web.
� Agents can call other agents.
� Agents can consist of simple actions, formulas, LotusScript, or Java programs.
� Agents can be distributed easily because they can be replicated.
� Agents can be shared or private.
Actions versus Agents
Agents are different from actions in that:
� Form and view actions work only when the form or view is open.
� Agents are not restricted to a specific form or view. Use agents to set up user-activated tasks or background tasks in any part of a Domino application.
Student Guide Page No. 219 435
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents...(continued)
Explain when to use agents
Use agents for complicated automated tasks and for automated tasks that are database-wide and domain-wide.
Examples of shared and private agents:
� Shared agent: An agent to archive or delete all documents in a database on a regular scheduled basis.
� Private agent: An agent used by one person to mark documents in a view as read, move them to a folder, mark them as "approved"
436 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents...(continued)
Examples of agents
Use agents to:
� Update a group of documents.
� Archive documents.
� Send messages and documents.
� Run other agents.
Types of agents
There are two types of agents:
� Shared agents are agents created by one user and can be run by other users or scheduled to run on the server.
� Private agents are agents that users create for themselves. Users cannot run another user’s private agent. Private agents are stored on the machine where the agent is created.
Once an agent is created, its type can be changed from shared to private, and vice versa, at a later date. This could be used to test a new agent on a “live” application before it is distributed generally.
Student Guide Page No. 220 437
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents...(continued)
Describe the parts of an agent
� Click the New Agent button to open a new blank agent.
� Point out the parts of the screen as shown in the Student Guide.
438 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents...(continued)
Parts of an agent
The following table describes the parts of an agent.
Part Function
Trigger Specifies when the agent program should run.
Target Selects which documents the agent program acts upon.
Program Specifies the code to execute.
Use options in the Agent Properties box to run a program:
� Manually or automatically
� Against all documents or a subset of documents in a database
The Agent Work pane
The following graphic shows the Agent Work pane:
Object pane Programmer’s Agent Properties box pane
Student Guide Page No. 221 439
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents...(continued)
Describe the options in the Basics tab
440 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Defining Agents...(continued)
The Agent Basics tab
In addition to naming an agent and determining its trigger and target, the Basics tab of the Agent Properties box has a few more options.
The following table lists these options and their function.
Option Function
Store search in search bar menu Displays the search query in the search bar.
Store highlights in document Search matches are highlighted in the searched documents.
Run in background client thread Runs an agent in the background without having to wait until it completes. Note that you should check this option only if the agent (or the top-level agent that calls this agent) is triggered by "On event - Action menu selection." To get the full benefit of this feature, the database should reside on a server and the agent must be invoked via the client.
Student Guide Page No. 222 441
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent
Run the Agent Demo
� Look at the document properties of a document in the Demo form documents view.
� Note that there is no AgentField in the document.
� Run the Agent Demo agent. The agent runs on all documents in a view.
� After running the agent, open the document properties of a document in the view. Show the new field in the Document Properties box.
Discuss the programming languages that can be used to create agents.
This course focuses on building agents with formulas.
442 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent
Before creating an agent, consider the following:
� When the agent runs.
� Which documents the agent processes.
� What program the agent runs.
Checklist: Designing an agent
Before creating an agent you should consider the following checklist.
Task Procedure
� 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 languages used to create agents
Agents can run any of the following types of programs:
� Simple functions
� Formula
� LotusScript
� Java
You can program an agent to do almost anything in an application.
Common formula agent tasks
Two common tasks in formula agents are to:
� Refine which documents the agent processes.
� Update fields in documents.
Student Guide Page No. 223 443
PreviewLesson 11 � Using an Agent to Update Documents
Designing and Agent...(continued)
Describe the Agent Properties box
444 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent...(continued)
The Agent Properties box
The following graphic shows the Agent Properties box.
Trigger
Basics tab
Trigger options
Target options
Student Guide Page No. 224 445
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent...(continued)
Show the SELECT statement in the Agent Demo agent
Compare this to the view selection formulas seen earlier in the course.
Show the formula in the Agent Demo agent
Explain that this type of agent can be very useful as you design and test an application.
446 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent...(continued)
Refining which documents to process
Formula-based agents run iteratively on the target documents. The number of documents that an agent processes directly affects the time it takes to execute the agent’s formula. To limit the target documents, use the SELECT statement.
The syntax for using SELECT is:
SELECT logicalValue
The following example selects only documents created using the Employee Information form:
SELECT Form=”Employee Information”
If you do not include a SELECT statement in the formula, 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.
Updating fields in documents
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 word used to add a value to a new or existing field.
The syntax for using FIELD is:
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 added along with the value Sunshine. The field does not become visible unless you add it to the form design, but you can access it by naming it in formulas.
Student Guide Page No. 225 447
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent...(continued)
Explain when and where the agent runs
Where the agent is in a client-server application influences when the agent runs. Agents can be run manually or automatically, based on a schedule.
� Manual agents run on the local Notes client.
� Scheduled agents can run locally or on a server.
Creating agents to run from a server poses deployment issues involving security and performance. Security will be handled in the next module, Module F. The focus of this lesson is creating an agent.
448 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent...(continued)
When the agent runs
Once you have decided what the agent is to do, you need to determine how you 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 Notes client
When triggered by an event
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 and examples of when to use them.
Event When to use it.
Before new mail arrives Before mail is deposited in the mail database; for example, to delete unwanted mail.
After new mail arrives Once new mail is delivered to the client; for example to forward mail while a user is on vacation.
After documents are created or modified
To update new or existing documents; for example, to change an area code for phone numbers.
When documents are pasted When copied documents are pasted into the database and need to be modified as they are being pasted; for example, to add the current date to the document.
Student Guide Page No. 226 449
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent...(continued)
Demonstrate creating a scheduled agent
Modify the Agent Demo agent to run at 10:00 pm.
Explain which documents the agent processes
This is similar to a view selection formula.
450 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Designing an Agent...(continued)
Scheduled events
The following table lists when agents can be scheduled to run.
Schedule Use for
More than once a day Critical tasks that are updated constantly. Note that a server’s performance can be adversely affected.
Daily Important tasks that aren’t as high priority as critical tasks; for example, sending a company wide email.
Weekly Routine tasks; for example, calculating a department’s sales performance.
Monthly Low priority tasks; for example, deleting older documents.
Never Agents that you do not want to run in particular circumstances; for example, agents that run on the Web or agents which are disabled or called by other agents.
Which documents the agent processes
Options for which documents the agent processes depend on when the agent runs.
The following table shows examples of which documents different agents can process.
An Agent that Runs... Can Process...
Manually from the Actions menu � Documents that users select � All documents in a view
When triggered by an event � Only new and modified documents
According to a schedule � All documents in the database � New documents and documents modified
since the last run of the agent.
Student Guide Page No. 227 451
PreviewLesson 11 � Using an Agent to Update Documents
Creating an Agent
Naming the agent
Discuss the best practices for naming agents.
452 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Creating an Agent
Create the agent after you have defined what your agent should do as well as when and where it should run.
Agent names
Agent names within the same database need to be unique. However, if the same agent is used in several different databases use the same agent name 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 an Action menu option.
The names you give to manually-run agents appear as options in the Actions menu. Use an alias (an internal name for an agent) when naming an agent. Thisallows you to change or translate the name that users see without disabling formulas that reference the original name.
Student Guide Page No. 228 453
PreviewLesson 11 � Using an Agent to Update Documents
Creating an Agent...(continued)
Create an agent
In the Practice database, demonstrate how to build an agent with the following options:
� Shared
� Act on documents created using the Demo Form.
� Add a dateModified field with the current date as its value.
454 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Creating an Agent...(continued)
Creating an agent
Follow these steps to create an agent.
Step Action
1 Open the database in 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 drop down list.
8 Select the appropriate documents for the agent to target from the target option drop down list.
9 Close the Agent Properties box.
10 Select the appropriate programming type from the drop list.
11 Type the program’s code into the Programmer’s pane.
12 Save and test the agent.
Student Guide Page No. 229 455
PreviewLesson 11 � Using an Agent to Update Documents
Exercise: Update Existing Documents
Present the review questions
� When would you use an agent rather than an action?
� What do you use to reduce the number of documents an agent has to process?
� What are the rules and guidelines you use when naming an agent?
Introduce the exercise
This exercise gives the students more practice writing the Formula language.
You may need to lead the students through working out the formula. The formula is listed here for your convenience.
REM {Select the rightmost 6digits of the number};REM {and make it text.};Temp := @Right(@Text(@DocumentUniqueID);6);REM {Set the PolicyNo field to "PN" plus Temp};FIELD PolicyNo := "PN" + Temp;SELECT @All
456 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 11 � Using an Agent to Update Documents
Exercise: Update Existing Documents
So far you have either left the policy number blank on Policy documents, or made one up. In this exercise you will write an agent that computes a policy number for all existing policies. The policy number should be formatted as “PN999999” where the characters “PN” are the first two characters in the policy number, and “999999” is calculated based on the right-most six characters of the document’s unique ID.
Tasks
� Write a formula that computes the policy number and saves the new policy number in the PolicyNo field.
� The agent should run on all existing policy documents.
� Run the agent and check the results.
Hint: Look up the @DocumentUniqueID.
Challenge: Modify the Policy form so that it computes a new policy number when a new Policy document is created.
Student Guide Page No. 230 457
PreviewLesson 11 � Using an Agent to Update Documents
458 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
F Working with Security Lesson 12 Defining Access to a Database
Lesson 13 Accessing Elements within a Database
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewLesson 12 � Def ining Access to a Database
Defining Access to a Database
Introduce the lesson
The Access Control List (ACL) defines which users can perform what tasks in a Domino application. This lesson describes access control levels, options, user types, and user roles.
460 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
12
PreviewLesson 12 � Defining Access to a Database
12 Defining Access to a Database
Domino offers database security at several levels. This module focuses on security to a database and within a database.
Objectives
After completing this lesson, you should be able to:
9 Describe how access control levels restrict access to a database.
9 Describe how access options refine the access control levels.
9 Describe how user types provide additional security to the access control levels.
9 Set the access restrictions for a database.
Student Guide Page No. 232 461
PreviewLesson 12 � Def ining Access to a Database
Database Security
Discuss the information on the student page
Discuss each of the levels depicted in the diagram.
Layer in the Diagram Description
Network This refers to access to the server over the wire.
Authentication The process of establishing “trust” between the server and that which is trying to access the server.
Domino Server Security This refers to the restrictions available in the server’s Server document.
Database Access (ACL) This refers to the levels of access controlled by the Access Control List (ACL) in a specific database.
Design Element Security This refers to anything from read access lists to controlling who can see a particular design element based on who they are.
Document Security This refers to Readers and Authors fields.
Field Security This refers to encryption. Note that the field on the form is where encryption is enabled. It is actually the data stored in the document that is encrypted.
Note: Typically the system administrator deals with the first three levels, so do not go into any detail about these. The database developer/manager deals with the last four layers of security.
462 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Database Security
Until this point, the focus of your database design has been on building an application that meets the needs of the users. Now that the process is near completion, database security becomes more critical. This includes securing the database from unauthorized entry as well as restricting user access within the database.
Domino’s layered security model provides many ways to customize security to the database and its content.
Domino’s layered security model
Domino’s layered security model provides increasing refinements to the security of the network, the Domino server, applications, and elements within each application. This model is depicted in the following diagram:
Student Guide Page No. 233 463
PreviewLesson 12 � Def ining Access to a Database
Working with Access Control Levels
Explain server access control
Typically, the Domino database manager, along with the Domino system administrator, determine which servers will be included in the ACL. Therefore, this lesson does not intend to cover access levels for servers beyond mentioning that they also must be included in the ACLs.
464 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Working with Access Control Levels
Access restriction begins at the network level. Once a user has been authenticated at this level, the next restriction is at the server level. Typically, network administrators and system administrators configure and maintain these two levels.
Once a network and server admits a user, that user encounters access restrictions or controls at the database level. Typically, Domino database managers configure and maintain this level using Access Control Lists (ACLs).
Access Control Lists
Every database includes an Access Control List. Manager access is required to modify the ACL. Managers of a Domino database add users (individually or in groups) to the ACL and assign them a certain access level that entitles them to work within the application.
When users attempt to open a database, Domino refers to the Access Control List to determine their privileges within the database.
Student Guide Page No. 234 465
PreviewLesson 12 � Def ining Access to a Database
Working with Access Control Levels...(continued)
Describe the types of access control levels
Open the Instructor database ACL as a visual aid as you walk through the table on the Student Guide.
466 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Working with Access Control Levels...(continued)
Types of access control levels
The following table lists each access control level and the privileges it gives to a user.
Access Control Level
Privileges
No Access No access to the database 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 cannot edit documents unless specified in the document itself.
Editor Editors can create, read, and edit all documents unless there 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 database design, but cannot delete the database or change its ACLs.
Manager Managers can perform all functions, including creating and modifying the ACLs and deleting the database.
Student Guide Page No. 235 467
PreviewLesson 12 � Def ining Access to a Database
Working with Access Control Levels...(continued)
Describe the Access Control List box
468 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Working with Access Control Levels...(continued)
The Access Control List box
The following graphic shows the Access Control List box.
Content Pane Name List Roles ListSelect access options
Student Guide Page No. 236 469
PreviewLesson 12 � Def ining Access to a Database
Working with Access Control Levels...(continued)
Explain how to identify users in the Access Control List
Show the groups and users in the Domino Directory
Briefly show students the groups and users that exist in the Domino Directory.
Discuss Anonymous access and Notes users
Domino servers can be set to accept Anonymous users accessing databases via Notes clients.
470 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Working with Access Control Levels...(continued)
Identifying users in the Access Control List
Domino identifies users listed in the Domino Directory. The Domino Directory is like a phone book of all the users and servers in the Domino environment. System administrators set up user names and groups of users that developers can use when defining access to applications.
The Access Control List defines access rights for users in four ways. The following table describes the purpose of each option.
Option/Description Defines Access for...
Default Any user who is not specifically listed in the ACL (individually or in a group).
Groups � A list of people who can all access the same functionality in the database
� If a user is a member of two groups, and both groups appear in the ACL, the user receives the higher access level.
Individual names � A specific Notes or Web user � This will override settings for any group to which the
individual belongs.
Anonymous � Any unauthenticated Notes or Web user. � If there is no Anonymous entry in the Access
Control List, unauthenticated users will use the Default access level.
Student Guide Page No. 237 471
PreviewLesson 12 � Def ining Access to a Database
Working with Access Control Levels...(continued)
Describe user access levels
Describe the user access levels from the student guide and from your own experience.
472 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Working with Access Control Levels...(continued)
Setting user access levels
The following are some examples of setting user access levels:
In order to... Set...
Prevent unknown users from accessing the database
Default to No Access.
Grant anyone the ability to read documents
Anonymous to the Reader access.
Allow all users in the Students group to modify the application
Students to Designer access.
Preview your forms in a Web browser, as you are working on the database design
Anonymous to Author access.
Student Guide Page No. 238 473
PreviewLesson 12 � Def ining Access to a Database
Working with Access Control Levels...(continued)
Display a database’s ACL
Demonstrate how to display an ACL and use it to restrict access.
� In the Instructor database on the server, modify the ACL so that the Students group has Depositor access.
� Ask each student to create and save a document using the Demo form. Have them use their own name (or their class user name) so they can recognize the their own documents.
� Ask them to try to read the document they just saved. They can’t open the document.
� Change the students’ ACL access from Depositor to Author.
� While the ACL dialog box is open, take the opportunity to ask students about their own access levels and the default access levels.
� Ask students to create, save, and read another document.
474 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Working with Access Control Levels...(continued)
Displaying a database’s ACL
Any user with access to a database is able to see its ACL.
Follow these steps to display the ACL of a database.
Step Action
1 Select or open the database in either the Notes Client or Domino Designer.
2 Choose FileÆDatabaseÆAccess Control from the menu.
Result: The Access Control List dialog box appears.
The Access Control List dialog box
There are four panels in the Access Control List dialog box. The following table lists each panel and its function.
This Panel... ...Is Where the Domino Database 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.
Student Guide Page No. 239 475
PreviewLesson 12 � Def ining Access to a Database
Refining Access Control Levels
Describe the different types of access options
Note that when Authors are given the option to delete documents, they can only delete documents that they created. To identify the author of a document requires an Authors field type.
Show the effect of changing an access option
Using the Instructor database:
� Ask students to try deleting one of the documents they created in the previous demonstration.
� Select the Delete Documents option for the Student group.
� Ask students to try deleting the document again.
476 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Refining Access Control Levels
Each access level has up to eight options that Domino database managers can turn on or off, further refining users’ privileges. For example, you can control whether users with Editor access can delete documents.
Types of access options
The following table describes the default and optional access privileges and which levels they are associated with.
Access Level
Automatic privileges Optional privileges
No Access � None � Read public documents � Write public documents
Depositor � Create documents � Read public documents � Write public documents
Reader � Read public documents � Create private agents � Create personal folders/views � Create Lotus-
Script/Java agents � Write public documents
(continued on next page...)
Student Guide Page No. 240 477
PreviewLesson 12 � Def ining Access to a Database
Refining Access Control Levels...(continued)
Continue describing the different types of access options
Do not spend time going over every single access option. It will be too confusing for the students. The entire list is here for clarity and reference.
478 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Refining Access Control Levels...(continued)
Types of access options
The following table continues listing the default and optional access privileges.
Access Level
Automatic privileges Optional privileges
Author � Read public documents � Create documents � Delete documents � Create private agents � Create personal folders/views � Create LotusScript/Java agents � Write public documents
Editor � Create documents � Read public documents � Write public documents
� Delete documents � Create private agents � Create personal folders/views � Create shared folders/views � Create LotusScript/Java agents
Designer � Create documents � Create private agents � Create personal folders/views � Create shared folders/views � Read public documents � Write public documents
� Delete documents � Create LotusScript/Java agents
Manager � Create documents � Create private agents � Create personal folders/views � Create shared folders/views � Create LotusScript/Java
agents
� Read public documents � Write public documents
� Delete documents
Enable the read and write public documents options to give users with No Access or Depositor access limited access to specific forms, views, and documents.
Student Guide Page No. 2416 479
PreviewLesson 12 � Def ining Access to a Database
Providing Additional Restrictions with User Types
Discuss other ways to prevent access
Referring to the scenario on the student page, ask students what other ways they could use to prevent Chris Jones from accessing the database.
Show where the Domino database manager applies user types
Show students where the database manager applies user types.
Discuss unspecified users
Depending on how much time you have, and the needs of the students, tell students that selecting Unspecified Users in the advanced panel attempts to lookup user types from the directory based on the name. The database manager selects this option.
480 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Providing Additional Restrictions with User Types
User types specify whether a name in the ACL is a person, server, or group. They can protect your database from the following scenario.
� Chris Jones opens the ACL to the Policies and Procedures database and notes that Terry Smith has Editor access.
� Chris Jones gets access to the server, creates a group called Terry Smith, and adds himself to the group.
Chris Jones now has access to the Policies and Procedures database as part of the group Terry Smith.
One way to prevent this is to designate Terry Smith as an individual with the Person user type.
Types of user types
The following table lists each user type, to whom it can be assigned, and what it does.
User Type Assigned to... Description
Person An individual user, including individuals on a server workstation
Enforces access as a single user.
Server A single server, including a server console and server workstation
Prevents someone from accessing the database from a Domino workstation using the server ID.
Server Group A group of servers Identifies a group of servers that will host replicas of the database.
Person Group A group of individual users
Grants Person access to each user in a group without listing each user in the ACL.
Mixed Group A group of servers and individual users
Grants the same access to a group of users and servers.
Unspecified Any user, group, or server
Has Domino look up the user type in the Address Book.
The database manager applies user types to meet the access restrictions.
Student Guide Page No. 242 481
PreviewLesson 12 � Def ining Access to a Database
Exercise: Set Access Restrictions to the Database
Introduce the exercise
Lead the students in a discussion about who will need to access the database and how much access these users need to have. Modify the ACL of the Instructor copy of the Policies and Procedures database. The results of this exercise will be used in the next lesson and exercise. Students will copy this file and use it for the next few exercises.
Allow 10 to 20 minutes for this group exercise.
User/Group Access Control Level
Default Depositor
Anonymous No Access
Employees Author
Policy Makers Editor
Department Head Author
Managers Manager
Designer Designer
Optional: If time allows, discuss the different privileges that students would or would not grant the user groups. For example, would Employees be allowed to create documents?
Suggested questions
The following questions can be used to help students design their ACLs.
� What type of access should regular employees have?
� How will the database handle non-recognized users?
� Who will control the database?
� Who can edit documents?
� Who can create and edit documents?
482 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 12 � Defining Access to a Database
Exercise: Set Access Restrictions to the Database
Worldwide Corporation’s Policies and Procedures application is almost ready to be deployed. However, security levels have not been established for all the different types of users. In this exercise you will determine the access control levels required for set the appropriate users.
Tasks
� Working with the instructor and the rest of the class, plan the ACL
Use the following table as a starting point to plan the access restrictions.
User/Group Access Control Level
Default
Anonymous
Employees
Policy Makers
Department Head
Managers
Designer
Student Guide Page No. 243 483
PreviewLesson 13 � Accessing Elements within a Database
Accessing Elements within a Database
Introduce the lesson
Notes to the instructor
In this lesson the students will COPY their databases to the server in order to properly test security functionality. This sets up for showing the difference between copying and replicating. Replication is covered in the next module.
484 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
13
PreviewLesson 13 � Accessing Elements within a Database
13 Accessing Elements within a Database
After users open a database, security measures can limit access to data and design elements such as documents, forms and views.
Objectives
After completing this lesson you should be able to:
9 Describe User Roles
9 Control access to various elements using User Roles
9 Describe Readers and Authors fields
9 Use Readers and Authors fields to control access to documents
Student Guide Page No. 244 485
PreviewLesson 13 � Accessing Elements within a Database
Setting Roles in a Database
Describe how to use roles
Describe examples of using roles in applications.
For example, hiding a Create action prevents the user from being able to create a document.
Roles and groups
� Explain the difference between roles and groups.
� Mention that groups can only be created and maintained by someone with administrative rights to the Domino Directory.
� Describe how roles work on local databases.
� Give examples of how roles can be used to refine access to elements in the application.
� Solicit other suggestions from the students.
Create user roles
Demonstrate creating roles in the Instructor database. Create at least three roles: one that all the students are members of and two more that divide the students into two groups, perhaps Aisle and Wall, or RightSide and LeftSide.
486 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Setting Roles in a Database
Roles provide a way to define a group within the database. Users and groups are assigned roles to refine access to particular views, forms, documents, or sections. Instead of assigning access to specific users and groups, assign access to the role.
Roles are functional after being:
� Defined in the ACL
� Used in a design element.
Advantages of using roles
Some 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’s Domino Directory.
� Make it unnecessary to modify the application when users leave or new users join.
Creating a role in the ACL
Follow these steps to create a role in the ACL.
Step Action
1 Choose FileÆDatabaseÆ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.
Student Guide Page No. 245 487
PreviewLesson 13 � Accessing Elements within a Database
Setting Roles in a Database...(continued)
Assign a role
Demonstrate assigning roles in the Instructor database. Assign the roles you created in the previous demonstration to the appropriate students.
488 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Setting Roles in a Database... (continued)
Assigning roles to users
Once a role is created, assign it to the appropriate users or groups listed in the ACL.
Follow these steps to assign roles to users or groups.
Step Action
1 Open the database in either the Notes Client or Domino Designer.
2 Choose FileÆDatabaseÆ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 them to determine what users can do or see in the database.
Student Guide Page No. 246 489
PreviewLesson 13 � Accessing Elements within a Database
Using Roles to Determine What the User Can Do or See
Explain the finished result of the next section--how to hide certain elements within a document from user’s whose role doesn’t match an approval list.
Describe how to capture a user’s role with @Functions
Provide examples of using these functions:
� @UserRoles
� @UserNamesList
� @IsMember
Direct students to Designer Help for more information and examples.
490 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Roles to Determine What the User Can Do or See
Incorporate roles into formulas to control access to parts of the application and to define responsibilities within the application. By using the name of the role in a formula, rather than actual user names, you simplify the construction of the formula and make the application easier to maintain.
Using roles in formulas
You can apply roles to further refine control within the application. For example,with roles you can control who can:
� Access specific views and folders
� Create documents
� Read the documents
� Edit the documents
� Access sections within the document
This section shows how to write a formula to determine who can see a specificdesign element based on a role. This involves capturing the current user’s roleand comparing it in a Hide When formula.
Capturing the user’s role
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 for the current user � Any roles for current user
Student Guide Page No. 247 491
PreviewLesson 13 � Accessing Elements within a Database
Using Roles to Determine What the User Can Do or See... (continued)
Explain the different ways formulas can compare user roles
Make note of the difference between !@IsMember and @IsNotMember. The two are not synonymous with each other.
492 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Roles to Determine What the User Can Do or See... (continued)
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 role matches an entry on the list.
Use the @IsMember function to determine if a user has a specific role. This function determines if a text string matches an item in a text list.
The syntax for using @IsMember is:
@IsMember(textValue; textListValue);
Use the @IsNotMember function to determine if a text string does not match an item in a list.
The syntax for using @IsNotMember is:
@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 the Student role
!@IsMember("[Student]"; @UserNamesList)
True, if the current user is not assigned the Student role
@IsNotMember("[Student]"; @UserRoles)
True, if the current user is not assigned the Student role.
Student Guide Page No. 248 493
PreviewLesson 13 � Accessing Elements within a Database
Using Roles to Determine What the User Can Do or See... (continued)
Write a Hide When formula based on a user role
� Use the Demo form to demonstrate how to write a Hide When formula that shows the Salary field to users with a particular role. For example, use @IsMember and @UserRoles to hide the field for everyone except the users in the Wall role.
� Test the formula by having students open Demo documents. Certain students will see the field, and other won’t depending on which Role they are included in.
Refer to the caution
Explain that Hide When is not true security.
494 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Roles to Determine What the User Can Do or See... (continued)
Using a formula to set the Hide When property
Follow these steps to hide a field with a formula.
Step Action
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).
Using Hide When to hide the contents of a field does not provide true security. Users can still see the contents of the field by using the Document properties box. Use encryption to secure the data in a field
Caution for Notes clients.
Student Guide Page No. 249 495
PreviewLesson 13 � Accessing Elements within a Database
Exercise: Create Roles
Introduce the exercise
Work through the first step with the class so that they all enter the same roles. Refer to the results of the previous exercise. The roles should be:
Role Description
Employees Employee
PWriters Policy and Procedure Writer
Designers Database Designer
Managers Manager
Note: In this exercise the students create the roles in the ACL. They will apply the roles in design elements later in this lesson.
496 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Exercise: Create Roles
In this exercise, you will create roles for the Policies and Procedures application and assign these roles to different users. For example, there are policy makers who should be able to view all documents and assign questions to the appropriate experts.
Tasks
Perform the following tasks to complete this exercise:
� Determine appropriate roles for the application. You will do this in conjunction with the instructor and the rest of the class.
� Create the roles in the Policies and Procedures database.
Student Guide Page No. 250 497
PreviewLesson 13 � Accessing Elements within a Database
Controlling Access to Documents
Lead a discussion
Discuss the various options for controlling who can create, read, or edit documents. When discussing who can read documents, note that the Read access list is a means of creating a $Readers field. Using a Readers field on the form is the preferred method.
498 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Controlling Access to Documents
Individual documents sometimes contain sensitive information. Domino's layered security model provides mechanisms to restrict access to a document.
The following table lists what methods control who can create, read, and edit documents.
Access 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 Create menu � Create access lists
This section focuses on using Readers and Authors fields to control document access.
Student Guide Page No. 251 499
PreviewLesson 13 � Accessing Elements within a Database
Using Readers Fields
Describe Readers fields
� Describe the relationship between Readers fields and the ACL.
� Emphasize in this section that it is NOT a best practice to explicitly list users and servers in readers fields.
� Ensure that servers are somehow included in the Readers field on every form so that documents will replicate among servers.
500 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Readers Fields
A Readers field restricts readership of a document to those users and servers that are listed in the field. It is a special type of text field designed to interact with the Access Control List (ACL).
By specifically listing users, groups, and roles in a Readers field, you can control who can read individual documents. This can be very useful in a scenario requiring an approval process. With a Readers field, you can restrict access to any documents that are not approved; if the documents are approved, the restrictions are unnecessary.
How Readers fields work with the ACL
Entries in a Readers field cannot give a user more access than what is specified in the ACL; they can only further restrict access. Users with No Access cannot gain access to a database even if their names are listed in a Readers field in a document in that database.
For example, users with Editor access or above in the ACL can be restricted from reading documents that have a Readers field if their names are not included in that field.
This type of access control only takes effect when the database is on a server. If you develop a database locally, you cannot test this feature until you copy the database to a server.
Caution
Viewing documents with Readers fields
When Domino builds a view, it indexes all documents that meet the selection criteria, regardless of whether those documents contain a Readers field. 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 the Readers field. Other users do not see those documents.
Thus, you do not need to alter the view to hide certain documents from general viewing.
Student Guide Page No. 252 501
PreviewLesson 13 � Accessing Elements within a Database
Using Readers Fields...(continued)
Demonstrate creating and using a Readers field
� In the Instructor database, use the Demo form to create a Readers field. Compute the value using @UserName. Create a document and have the students try to open it.
� Go back and change the formula to include @UserName plus a role that contains all of the students.
� Have the students create another Demo document.
� Now have the students try to open it. Ask them if they can edit it.
Note: Make sure the students understand that the Readers field restricts access. Even an Editor or Manager can be restricted from reading (and therefore editing) a document
502 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Readers Fields...(continued)
Specifying Readers
Entries in a Readers field must compute to a text value. Designers and managers specify readers in a Readers field by using one of the following methods:
� Write a formula to compute user names, roles, or groups. This is the most frequently used option, as it allows designers to predetermine the readers. For example:
"[Policy Managers]" : "Suzy Sunshine" : "Managers"
� Make the field editable, so application Authors and Editors can select and change readers.
Creating a Readers field
Follow these steps to create a Readers field.
Step Action
1 Open a form in Designer.
2 Create a field, selecting Readers as the field data type.
3 Specify the readers.
Student Guide Page No. 253 503
PreviewLesson 13 � Accessing Elements within a Database
Using Authors Fields
Explain how to use Authors fields
Users with Author access (in the ACL) cannot edit the documents they create, unless their names are in the document’s Authors field.
An Authors field identifies which users or groups with Author access to the database can edit a document.
The name in the Authors field must be the complete Notes hierarchical name.
504 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Authors Fields
A user with Author access to a database may be able to create and read documents. By default, they cannot edit documents — not even the documents they create themselves. For users with Author access to edit the documents they create, they must be listed in an Authors field in the document.
This section describes how to use an Authors field to define editing capabilities for users with Author access to the database.
Describing Authors fields
An Authors field is a type of field that works in conjunction with the Author access level in the database’s Access Control List. Authors fields do not override the settings in the Access Control List. They offer developers more control over which users can edit data in the application.
Users with an access level that gives them edit privileges (Editor or higher) can edit any document that they can see, even if their names are not in the Authors field of a document. Similarly, users with a level of No Access cannot edit a document, even if their names are in the Authors field.
When to create an Authors field
Include an Authors field on the form to store the name of the user when the document is created. An Authors field can store one or more user names or groups and can be editable or computed.
Student Guide Page No. 254 505
PreviewLesson 13 � Accessing Elements within a Database
Using Authors Fields...(continued)
Describe how Authors and Readers fields work together
To get the point across about how Authors and Readers fields work separately and together, work through the table on the Student Guide with the students. This table is not meant to be all-inclusive. It is simply a representative sample of the possible permutations of access control within a database.
506 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Authors Fields...(continued)
How Authors and Readers fields work together
The following table is a representative sample of the possible permutations of access control within a database.
ACL Level Authors Field Exists and User Is
in It
Readers Field Exists and User Is
in It
Can Read Document
Can Edit Document
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 No
Editor No Yes Yes Yes
Editor No No No No
Reader Yes No No Yes
Reader No Yes Yes No
Reader No No No No
Student Guide Page No. 255 507
PreviewLesson 13 � Accessing Elements within a Database
Using Authors Fields...(continued)
Discuss using editable vs. computed Authors fields
� When would you use an editable Authors field?
� When would you use a computed field?
� What type of computed field would you use?
� Would you ever use a Computed for display field for an Authors field?
Create an Authors field
Demonstrate how to create an Authors field.
� Ask students to try to edit the documents they created in the Instructor database.
� Add an Authors field with @UserName to the Demo form.
Ask students to create a new document with the Demo form and then to try to edit it.
508 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Using Authors Fields...(continued)
As with Readers fields, you can compute the value of an Authors field, or allow the user to select Authors for the document.
Use the @UserName function to capture the name of the current Notes user. You can use this function to dynamically compute the value of an Authors field.
Creating an Authors field
Follow these steps to create an Authors field.
Step Action
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 the field type.
3 Select one of the following to determine when the field obtains its value. � Editable allows those who create the document to designate who can
edit the document. � Computed fills in the value based on a formula each time the
document is refreshed. � Computed when composed will evaluate only if the data does not
already exist. This value is computed only once. � Computed for display. Because they do not store an item or a value
in a note, Computed for display is not appropriate for this type of field.
4 Enter a formula to calculate the value of the field. Note: Computed fields must have a formula. Editable fields can use a formula to calculate a default value that the user can change.
Student Guide Page No. 256 509
PreviewLesson 13 � Accessing Elements within a Database
Controlling Access for Anonymous Users
Discuss the material on the student page
In some cases, anonymous users will be allowed access to the server. This does not mean that anonymous users will automatically have access to a database on that server. In fact, you may want to restrict access to the database by anonymous users.
If anonymous access to the database is required, then anonymous users must be accounted for in the ACL of the database. Discuss the sample ACLs for low-security and high-security databases.
Note the differences in the low-security and high-security ACLs.
510 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Controlling Access for Anonymous Users
Users who have Internet or intranet access to a database cannot be identified by Notes in the way Notes users are identified. Domino provides ways for you to determine the maximum Internet name and password access level.
Setting up anonymous access
Follow these steps to allow anonymous users to access a database.
Step Action
1 Open the database in Designer.
2 Open the database’s Access Control List.
3 Add an entry for the group Anonymous.
4 Assign the access level you want to give to anonymous users.
Setting a low security ACL for a Web database
The following table illustrates an ACL for a low-security discussion database.
Web User Access Level
-Default- Author
Anonymous Author
Supervisors Editor
Maximum Internet name and password access
Editor
Student Guide Page No. 257 511
PreviewLesson 13 � Accessing Elements within a Database
Controlling Access for Anonymous Users...(continued)
Discuss the difference between the low and high security ACL examples
512 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Controlling Access for Anonymous Users...(continued)
Setting a high security ACL for a Web database
The following table illustrates an ACL for a high-security confidential database.
Web User Access Level
-Default- No Access
Anonymous No Access
Authorized readers Reader
Contributors Author
Supervisors Editor
Maximum Internet name and password access
Reader
Student Guide Page No. 258 513
PreviewLesson 13 � Accessing Elements within a Database
Exercise: Control access to documents in the Policies and Procedures application
Introduce the exercise
This is a very involved exercise. In order for the students to effectively test their work, create teams of students to work together after they have implemented their changes.
Make sure that they are using the Policies database that they copied from the instructor so that they have the same groups, users and ACLs.
514 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 13 � Accessing Elements within a Database
Exercise: Control access to documents in the Policies and Procedures application
In this exercise you will control access to documents in the Policies and Procedures application based on the following:
� All employees should be able to read any document in the application.
� The people who create documents should be able to edit them.
� Members of the Managers and Policy Makers groups should be assigned the PWriters role.
� Only people assigned the PWriters role should be able to create Policy documents.
� All employees can create Question documents.
� Only the person who creates a Question should be able to modify it.
� Only PWriters should be able to create and edit Answers.
Tasks
This exercise involves making changes to the ACL and the Policy, Question, and Answer forms.
Determine the changes that need to be made and implement them. Work with other students to help test that your application works as expected.
Student Guide Page No. 259 515
PreviewLesson 13 � Accessing Elements within a Database
516 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
G Deploying the ApplicationLesson 14 Preparing and Deploying the Application
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewLesson 14 � Deploying the Applicat ion
Preparing and Deploying the Application
Introduce the lesson
518 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
14
PreviewLesson 14 � Deploying the Application
14 Preparing and Deploying the Application
After an application has been designed, developed, and tested, there are a few more things to do before putting it into production.
Objectives
After completing this lesson you should be able to:
9 Create a template from an existing database
9 Create a new database from the template
9 Link a database template to a database
9 Set the ACL of your application to allow proper replication
9 Describe Domino’s replication process
9 Create a database replica on a server
Student Guide Page No. 262 519
PreviewLesson 14 � Deploying the Applicat ion
Controlling Application Maintenance
Discuss the checklists on the student page
520 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Controlling Application Maintenance
There are a number of ways to control application maintenance. Barbara A. Bolin and R. Benjamin Ordonez in their book Lotus Notes: The Complete Reference, published by The McGraw-Hill Companies, Inc., recommend that you use three templates:
� A production template which contains the design of the production database. You update the production database with the production template.
� A development template which you use to perform updates and bug fixes. Once you finish testing the modifications, you replace the production template with the development template.
� A backup template which is the previous version of the production template. You want this in case you need to roll back to the previous version. Make a backup of the production template before you replace it with the newer development template.
Checklist: Rolling out an application
The following checklist includes recommended steps to use when rolling out a new application:
Step Process
1 Create a template out of the new database.
2 Create a new database from the newly created template.
3 Modify the ACL of the new database so that it will replicate correctly.
4 Create a new replica of the database on the server.
Checklist: Updating the design of an application
The following checklist includes recommended steps to use when updating an application design:
Step Process
1 Update the design of the template. Test.
2 Refresh the design of the local database. Test.
3 Replicate with the server to replicate the design changes. Test.
Student Guide Page No. 263 521
PreviewLesson 14 � Deploying the Applicat ion
Database Templates
Show the list of standard design templates
522 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Database templates
A template is a Domino file that contains the design structure for a Domino database. File extensions differ for databases and templates. The file extension for a Domino database is .NSF. The file extension for a Domino template is .NTF.
When you use a template to create a database, like you did in Module A, the database receives the design elements from the template.
IBM Lotus Notes and Domino contain several standard database templates. You can create an application from a standard template, customize the standard templates to meet your needs, or create a custom template from scratch.
Example standard Domino templates include:
� Discussion
� Document Library
� Personal Journal
� Personal Address Book
Student Guide Page No. 264 523
PreviewLesson 14 � Deploying the Applicat ion
Using Master Design Templates
Discuss the use of templates for controlling modifications to an application design
When you need to modify or add to your application’s design, you can do the work in the template and refresh the design of the working, application database.
You can choose to refresh all design elements, or individual elements.
Ask: How many of you have ever refreshed the design of your mail file?
When upgrading to new releases of Notes, users often need to refresh the design of their mail databases to have the latest forms and views, such as the calendar view.
524 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Using Master Design Templates
Design templates let you isolate the design and development of an application from the production environment. By managing application design modifications using a master design template, you avoid disruption to an application that has been deployed.
Creating a master design template
Create the master design template in two steps:
� Extract the design elements of your database to a new database
� Designate the new database as a template.
Once the template is created, link the database template to your application database.
Student Guide Page No. 265 525
PreviewLesson 14 � Deploying the Applicat ion
Using Master Design Templates...(continued)
Demonstrate creating a master design template
526 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Using Master Design Templates...(continued)
Extracting the design from the database
Follow these steps to extract the design elements to another database which will become the master design template:
Step Action
1 Select the database in either Notes or Designer.
2 Choose File Æ Database Æ New Copy.
3 Select the location to store the new database.
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 simply causes it to appear as a choice in the list of templates when you create a new database.
6 Click Copy: Database design only.
Student Guide Page No. 266 527
PreviewLesson 14 � Deploying the Applicat ion
Using Master Design Templates…(continued)
Demonstrate the procedures on the student page
528 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Using Master Design Templates…(continued)
Turning a database into a template
Follow these steps to turn a database into a template:
Step Action
1 Select or open the database.
2 Open the Properties box.
3 Click the Design tab.
4 Click the check box to enable the Database file is a master template property.
5 Enter the template name. The template name is the link between the template and the database or databases.
Linking the application database to the master design template
Once you create the master design template, follow these steps to link it to your application database:
Step Action
1 Select or open the database.
2 Open the Database Properties box.
3 Click the Design tab.
4 Click to place a checkmark next to Inherit from template.
5 Enter the name of the template.
Student Guide Page No. 267 529
PreviewLesson 14 � Deploying the Applicat ion
Exercise: Create a design template and a new database
530 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Exercise: Create a design template and a new database
Now that the Worldwide Policies application has been designed, developed, and tested, it is time to make a design template from the database and prepare to deploy the application.
Tasks
In order to complete this exercise, do the following:
� Create a template from the Policies database you created during the course.
� Create a new Policies database from the template.
� Make sure that the new database is set to inherit future design changes from the template.
Student Guide Page No. 268 531
PreviewLesson 14 � Deploying the Applicat ion
Describing the Domino Replication Service
Explain what the Domino replication service does
Explain the replication process, including the following points:
� Replication allows users on various networks in a variety of locations to share the same information.
� When you replicate, Notes updates the replicas, copying changes from one to the other. Domino eventually makes all replicas identical.
� You can replicate between two servers, or between a workstation (such as a laptop) and a server.
532 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Describing the Domino Replication Service
Replication is the process of synchronizing multiple instances, or copies, of a database on multiple servers and workstations. Running separate instances of a database on multiple servers provides two benefits:
� It allows developers and administrators to distribute applications across geographic locations for faster access.
� It allows users to work with an application offline, and then add (or replicate) their changes when reconnected to the network.
The Domino replication service
The Domino replication service transfers new and modified notes between databases. The following diagram illustrates the concept of replication.
Student Guide Page No. 269 533
PreviewLesson 14 � Deploying the Applicat ion
Describing the Domino Replication Service...(continued)
Define replica databases
A replica differs from a database copy, in that the original database and its replica have the same replica ID number.
Display a database replica ID
Open the Database Properties box and show students the replica ID on the Info tab.
Briefly explain what happens during replication
Describe the general process of replication.
In the next section, we will examine how ACL and replication settings affect what replicates.
Describe why some data does not replicate
View indexes do not replicate because replica databases can contain different documents, so the indexes may not be correct. Also, view indexes can be very large and would slow down replication.
Each replica database maintains its own file system information. This data is irrelevant to replication.
534 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Describing the Domino Replication Service...(continued)
Replica databases
Replica databases are databases that share the same replica ID. The replica ID is generated automatically when a database is created.
Replication can only occur between Domino databases that have the same replica ID. The names of two database replicas can be different, and they can contain different documents or implement different designs. However, if their replica IDs are the same, they can replicate with each other.
What happens during replication
Replication is initiated by a Domino server or a user in the Notes client. During the replication process, the two servers (or the client and server) do the following:
� Authenticate with each other.
� Build a list of document, design element, and ACL changes since the last replication.
� Transfer the changes to the replica databases. Domino only replicates the items that have changed — not the entire document or design element. Before the servers transfer changes, they check the ACL of the replica databases. Domino can only transfer those changes permitted by the ACL.
Data that does not replicate
The following data does not ever replicate:
� View and FullText indexes
� File system information (for example, the database file name and path)
Student Guide Page No. 270 535
PreviewLesson 14 � Deploying the Applicat ion
Controlling What Replicates
Explain the effects of the ACL on replication
Do not simply upgrade the server to editor to avoid listing the server name in the Authors item of a document. That is a violation of the first rule of security: Give the minimum access available to get the job done.
536 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Controlling What Replicates
This section describes the following three ways of controlling the data that replicates:
� Controlling server access to the database
� Readers of a document
� Replication settings of the database
Controlling server access to the database
The data that replicates is dependent on the rights of who is doing the replicating. The following table describes the effects of ACL settings on replication.
Server Access Level in the Replica Database
ACL
Effect on Replication
No Access No replication occurs.
Depositor Server can send new documents, but cannot receive any documents.
Reader Server can receive changes, but cannot send changes.
Author Server can send the following changes:
� New documents created since last replication. � Modifications to documents that list the replicating
server (or user) in an Authors item. If the server is replicating changes, and it has Author access to the replica database, the server (in addition to the user who created the document) must be listed in the Authors item for replication to occur.
Editor Server can send all new documents and changes to existing documents.
Designer Server can send all new and modified documents and design elements.
Manager Server can send all new and modified documents, design elements, and the ACL.
Student Guide Page No. 271 537
PreviewLesson 14 � Deploying the Applicat ion
Controlling What Replicates...(continued)
Readers and replication
A replicating server must be listed as a reader of a document.
538 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Controlling What Replicates...(continued)
Readers and replication
Documents that contain Readers items must list the replicating server as well as users. The server must be able to read the document to replicate it. If the server is not listed as a reader of the document, the document will not replicate.
Replication settings
Replication settings allow a further refinement of which documents are going to replicate between any two servers, and between client and server. The following table describes these settings.
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 database title and catalog info to other
replicas. � Do not send changes in local security property to other replicas.
Other � Temporarily disable replication. � Scheduled replication priority. � Only replicate incoming documents saved or modified after. � CD-ROM publishing date.
Advanced � Replicate a subset of Documents between specified servers or specified client and server.
� Replicate specific types of design elements.
Student Guide Page No. 272 539
PreviewLesson 14 � Deploying the Applicat ion
Creating Replicas
Review the procedure
Make note that depending on the production environment, application developers may not be able to create new replicas on a production server.
540 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
1
2
3
4
5
6
PreviewLesson 14 � Deploying the Application
Creating Replicas
Creating replicas manually
Follow these steps to manually create a replica:
Step Action
Open the database.
Choose FileÆReplicationÆNew Replica.
Select the destination server (server on which to place the replica).
Keep the default file name and title for the new replica.
Select Create: Immediately.
Select Copy Access Control List to copy the ACL from the original to the new replica. Click OK.
Student Guide Page No. 273 541
PreviewLesson 14 � Deploying the Applicat ion
Exercise: Roll out the Policies application
Introduce the exercise
542 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewLesson 14 � Deploying the Application
Exercise: Roll out the Policies application
In this final exercise you will make modifications to the Policies application that will allow for proper replication of the application. You will also test the application.
Tasks
� Modify the ACL of the newly created Policies database so that all documents and design changes will replicate.
� Create a new replica of the Policies database on the classroom server.
� Create some new documents in the server copy of the database. Replicate with the local copy to show that the documents replicate properly.
� In the template, change the design of the Policy form. Perhaps modify the background or header.
� Refresh the design of your local Policies application. Open an existing Policy document to see the new change.
� Lastly, replicate the Policies application from local to server in order to see that the design change replicates.
Student Guide Page No. 274 543
PreviewLesson 14 � Deploying the Applicat ion
544 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
AAppendix
Exercise Solutions
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewAppendix A � Exercise Solut ions
Lesson 3: Create a database, and a form that contains a table and fields
This solution has three parts:
� Build a new database
� Create a new form
� Add elements, such as text and fields, to the form
Create a database
Follow these steps to create the Policies and Procedures database.
Step Action Result
1 Open Domino Designer.
2 Choose FileÆ DatabaseÆ New. The New Database dialog box appears.
3 Accept the default of Local to create the database on the local computer.
4 Enter the title Policies and Procedures
for the database.
Policies and Procedures appears in the title box.
5 Enter the file name Policies_ABC.nsf.
Replace ABC with your initials
Policies_ABC.nsf appears in the file name box.
6 Select -Blank- from the template list.
7 Click OK. The new database is created.
A � 2 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 3: Create a database, and a form that contains a table and fields...(continued)
Create a form
Follow these steps to create the Policy form.
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 In the Design pane, click Forms. In the Work pane, the list of existing forms appears. The New Form button appears on the button bar.
3 In the Work pane, click New Form.
4 Choose Design Form ÆProperties
The Form properties box opens.
5 Enter Policy in the Name field. Note: It is a good idea to give the form an alias.
Policy appears in the name box.
6 Close the properties box.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 3
PreviewAppendix A � Exercise Solut ions
Lesson 3: Create a database, and a form that contains a table and fields...(continued)
Format the Policy form
Follow these steps to format the Policy form.
Step Action Result
1 Type Policies and Procedures at the top of the form.
The text appears on the form.
2 Press Enter several times to move the cursor below the title text.
The cursor flashes to indicate its position.
3 Click and drag to highlight the text. Choose TextÆText Properties.
The Text properties box opens.
4 Change the font style and size. For example, Arial Black, 14 pts. Navy Blue.
The title text reflects the changes.
5 Close the Text Properties box.
6 Click below the title text to position the cursor where you’d like the table to appear.
7 Choose CreateÆTable. The Create Table box opens.
8 Create a Basic table with the following options: � 5 rows � 2 columns � Fixed Width
Click OK.
The table appears on the form.
9 Type the following field labels in the cells of the first column: � Policy Number:
� Policy Title:
� Effective Date of the Policy:
� Category:
� Display Category:
The field labels appear in each cell in the first column.
(continued on next page...)
A � 4 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 3: Create a database, and a form that contains a table and fields...(continued)
Format the Policy form, continued
Follow these steps to format the Policy form.
Step Action Result
10 Click in the cell to the right of the first field label, Policy Number.
11 Choose Create ÆField to create a field with the following characteristics: � Field name: PolicyNo � Field Type: Text, Editable
The PolicyNo field is created in the first cell of the right column.
12 Click in the cell to the right of the Policy Title field label. Repeat step 11 with the following characteristics: � Field name: PolicyTitle � Field type: Text, Editable
The PolicyTitle field is created in the the right column.
13 Click in the cell to the right of the Effective Date field label. Repeat step 11 with the following characteristics: � Field name: EffectiveDate � Field type: Date/Time, Editable
The EffectiveDate field is created in the the right column.
14 Click in the cell to the right of the Category field label. Repeat step 11 with the following characteristics: � Field name: Category � Field type: Dialog List, Editable
The Category field is created in the the right column.
15 Click in the cell to the right of the Display Category field label. Repeat step 11 with the following characteristics: � Field name: DCategory � Field type: Text, Computed
The DCategory field is created in the the right column.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 5
PreviewAppendix A � Exercise Solut ions
Lesson 3: Create a database, and a form that contains a table and fields...(continued)
Format the Policy form, continued
Follow these steps to format the Policy form.
Step Action Result
16 Select the Category field and click the Control tab. Type the following in the Choices box: � Office Guidelines
� Benefits
� Holidays
� Grievance Procedures
The category choices are created.
17 Click and drag to highlight the Category row. Click the Hide/When tab and select to Hide paragraph when document is: � Previewed for reading � Opened for reading � Printed
The Categories row will not be seen when the document is in read mode.
18 Select the DCategory row. Click the Hide/When tab and select to HIde paragraph when document is: � Previewed for editing � Opened for editing
The Display Category row will not display when the document is being edited.
19 Close the Field properties box.
20 Enter the following formula in the Programmer’s Pane of the DCategory field: Category
The option selected in the Category field will display in the DCategory field when the document is in Read mode.
21 Save and test the form in the Notes client.
A � 6 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 4: Create a Categorized View
Create a categorized view
Follow these steps to create a view that displays documents created using the Policy form.
Step Action Result
1 Open the Policies and Procedures database in Designer.
The database opens in the Work pane.
2 In the Design Pane, click Views.
3 In the Work pane, click New View. The Create View box opens.
4 Name the view, Policies. Click OK. The Policies view appears in the view list.
5 Open the Policies view. The Policies view opens in the Work pane.
6 Click Add Condition in the View Programmer’s Pane.
The Add Condition dialog box opens.
7 Select By Form from the Condition drop-down list.
A list of the forms in the Policies and Procedures database appears.
8 Select the Policy form. Click Add. Uses ‘Policy’ form appears in the Programmer’s Pane.
9 Double click the first view column to open the Column Properties box. Select the following option on the Column Info tab: � Name: Policy � Width: 25
10 In the Programmer’s Pane, select Field. Select the PolicyTitle field.
The first column displays the policy titles.
(continued on next page...)
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 7
PreviewAppendix A � Exercise Solut ions
Lesson 4: Create a Categorized View...(continued)
Create a categorized view, continued
Follow these steps to continue building a categorized view:
Step Action Result
11 Choose CreateÆAppend New Column to add a column to the right with the following options: � Name: Effective Date � Width:10 � Field: EffectiveDate
A column displaying the policy effective date appears to the right of the Policy Name column.
12 Save and preview the view.
Create a categorized column
Follow these steps to add a categorized column to the Policies view.
Step Action Result
1 Open the Policies view in Designer. The Policies view opens in the Work pane.
2 Choose CreateÆInsert New Column to add a column to the left with the following options: � Name: blank � Width: 1
A new blank column is inserted to the left of Policy Name.
3 Click the Sort tab and select the following options: � Sort: Ascending � Type: Categorized
4 In the Programmer’s Pane, select Field. Select the Category field.
The document categories are listed in the work pane.
5 Save and refresh the view
A � 8 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 5: Create a Page
This solution has three parts:
� Create shared images
� Create a page
� Modify the page
Create shared images
Follow these steps to create shared images for the Policies and Procedures database.
Step Action Result
1 Click Shared Resources in the Design list.
2 Click Images. A list of shared images appears in the Work pane.
3 In the Work pane, click the New Image Resource button.
The New Image Resource dialog box opens.
4 In the New Image Resource dialog box, browse for and select the following image files: � LOGO WW1.gif � bluerule.gif Click Open.
The images are added to the shared resources list.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 9
PreviewAppendix A � Exercise Solut ions
Lesson 5: Create an Introduction Page...(continued)
Create an Information page
Follow these steps to create an Information page in the Policies and Procedures database.
Step Action Result
1 Click Pages in the Design list.
2 Click New Page. A new, blank page opens in the Work pane.
3 Choose DesignÆPage Properties.
The Page Properties box opens.
4 Name the page, Information. Close the Page Properties box.
5 Save the Information page.
Modify the Information Page
Follow these steps to modify the Main page.
Step Action Result
1 With the cursor in the Information page, choose CreateÆ Table
The Create Table box opens.
2 Create a fixed width table with 2 rows and 1 column. Click OK.
A table with 2 rows and 1 column is created.
3 Click in the top cell and choose Create ÆImage Resource.
The Image Resource
4 Select the LOGO WW1.gif file and click OK.
The Worldwide logo is added to the first cell.
5 Click in the bottom cell and enter the following text: 123 Worldwide Blvd.
Metropolis, PA 45555
Worldwide’s address appears below the company logo.
A � 10 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 5: Create an Introduction Page...(continued)
Modify the Information page, continued
Follow these steps to continue modifying the Main page.
Step Action Result
6 Click below the table. Choose CreateÆImage Resource.
The Image Resource box opens.
7 Select bluerule.gif. Click OK. The bluerule.gif image is added below the table.
8 Click below the bluerule.gif image. Enter the following text: Worldwide is an international pottery manufacturer. The company sells ceramics worldwide. Products include tiles, china, and various kinds of pottery. The corporate office houses manufacturing, research and development, product management, quality control, human resources, and system administration. There are several smaller sales offices and resellers throughout each region, and some sales representatives who work from their homes.
The text is added to the page.
9 Click and drag to highlight the text. Choose Create ÆSection.
A twistie appears to the left of the text.
10 Choose SectionÆSection Properties and change the Title to About Worldwide. Select a border style.
The Section heading About Worldwide is created with a border around it.
11 Save and preview the page.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 11
PreviewAppendix A � Exercise Solut ions
Lesson 6: Interpret Formulas
Given the Following data:
FirstName: SusanLastName: SunshineCreated on 3/7/99 at 11:59:37 PM
The following table shows the results of each formula.
Formula Result
FirstName Susan
“LastName” LastName
FirstName + LastName SusanSunshine
LastName + “, “ + FirstName Sunshine, Susan
FirstName = “Susan” True
(FirstName != “Larry”) & (LastName = “Sunshine”)
True
@Adjust (@Created; 0; 6; 0; -2; 0; 0) 9/7/99 4:59:37 AM
@If (@Created < @Today; “Old”; “New”) Old
@Text (10.22) Text value, 10.22
fullName := FirstName +“ “ + LastName;
“Welcome back, “ + fullName
Welcome back, Susan Sunshine
A � 12 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 7: Create a Dynamic Title for the Policy Form
Follow these steps to complete the exercise.
Step Action Result
1 Open the Policy form in Designer. The form appears in the Work pane.
2 In the Object tab, select Window Title.
The Programmer’s pane is empty.
3 In the Script area, enter the following formula: @If(@IsNewDoc;”New Policy”; PolicyTitle)
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. Designer stores the changes in the database.
5 Preview the form. The title should display as New Pol-icy.
6 Open an existing Policy in Notes. The policy’s name is displayed in the title.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 13
PreviewAppendix A � Exercise Solut ions
Lesson 7: Automate Data Entry and Formatting
This solution consists of the following parts:
� The policy title should be formatted using proper case.
� Create a field to capture the date the policy is created. This date should be displayed without the time element. Name it PolicyCreatedDate.
� The effective date should calculate to one month from the date the policy is created in order to account for an internal review process. This date should also be displayed without the time.
� When a policy is created, the document should not be saved unless it contains a title and category.
Make sure PolicyTitle is entered in proper case
Follow these steps to make sure the Policy’s title is always entered in proper case.
Step Action Result
1 Open the Policy form in Designer.
2 Highlight the PolicyTitle field. The PolicyTitle field and its objects appear in the Objects list.
3 In the Script area, enter the following formula in the Input Translation object for the field: @ProperCase(PolicyTitle)
The formula appears in the Script area.
4 Save and test the form.
A � 14 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 7: Automate Data Entry and Formatting...(continued)
Have Domino enter the entry date
Follow these steps to have Domino automatically enter the document’s entry date and display the date only.
Step Action Result
1 Place the cursor in the third row of the table on the Policy form.
2 Choose Table Æ Insert Row. A blank row is inserted above the Effective date row.
In the left cell type the field label: Created Date:
The text appears in the left cell.
3 Move the cursor into the right cell. Choose Create Æ Field.
The Create Field box opens.
4 Name the field PolicyCreatedDate with the following options: Field Type: Date/Time Computed
The PolicyCreatedField is added to the right cell.
5 Select the Value object for the PolicyCreatedDate field.
6 In the Field info tab, change the field to Computed when composed.
7 In the Script area, enter: @Created
The formula appears in the Script window.
8 Open the field properties box and click the Control tab. In the Show dialog box, select Only month, day, year.
The Control tab of the field properties box is displayed.
9 Save and test the form.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 15
PreviewAppendix A � Exercise Solut ions
Lesson 7: Automate Data Entry and Formatting...(continued)
Calculate the EffectiveDate of the policy
Follow these steps to calculate the EffectiveDate of the policy based on the PolicyCreatedDate.
Step Action Result
1 Open the Policy form in Designer.
2 Highlight the EffectiveDate field. The EffectiveDate field and its objects appear in the Objects list.
3 Open the Field properties. Change the field from Editable to Computed.
The field type is changed to indicate that the field is going to be computed.
4 In the Script area, enter the following formula in the Value object for the field: @Adjust(PolicyCreatedDate;0;1 ;0;0;0;0)
The formula appears in the Script window.
5 Save and test the form.
A � 16 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 7: Automate Data Entry and Formatting...(continued)
Verify fields before saving
Follow these steps to verify that certain fields contain a value before allowing a document to be saved.
Step Action Result
1 Highlight the PolicyTitle field. The PolicyTitle field and its objects appear in the Objects list.
2 In the Script area, enter the following formula in the Input Validation object of the field: @If (PolicyTitle != ""; @Success; @Failure("Please enter a Policy Title."))
The formula appears in the Script area.
3 Repeat Steps 1 and 2 for the following Category field. Use the following formula: @If (Category != ""; @Success; @Failure("Please enter a Category."))
The formula appears in the Script area.
4 Preview the form to test the formulas.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 17
PreviewAppendix A � Exercise Solut ions
Lesson 7: Compute a List of Choices for a Field
This solution consists of the following parts:
� Create a Category form with a Category field
� Use the Category form to create several documents
� Build a view to display only Category documents
� Modify the Policy form so the Category field gets its value from the Categories view
Create a Category form
Follow these steps to build the Category form.
Step Action Result
1 Open the Policies database in Designer.
2 In the Design pane, click Forms. In the Work pane, the list of existing forms appears. The New Form button appears on the button bar.
3 In the Work pane, click New Form.
4 Choose Design Form ÆProperties
The Form properties box opens.
5 Enter Category in the Name field. Note: It is a good idea to give the form an alias.
Category appears in the name box.
6 Close the 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
A field named Category is created.
9 Save the form and test in the Notes client.
A � 18 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 7: Compute a List of Choices for a Field...(continued)
Use the Category form
Follow these steps to build documents using the Category form.
Step Action Result
1 Open the Notes client
2 Choose File Æ Database Æ Open. Browse for and open the Policies and Procedures (Policies_ABC.nsf) database.
The database opens.
3 Choose Create Æ Category to create a document using the Category form.
The Category form opens.
4 Enter Office Guidelines in the Category field. Save and close the document.
The document closes.
5 Repeat steps 3 and 4 with the following categories: � Benefits
� Holidays
� Grievance Procedures
� Security
� Email Etiquette
� Diversity
6 additional documents are created using the Category form.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 19
PreviewAppendix A � Exercise Solut ions
Lesson 7: Compute a List of Choices for a Field...(continued)
Create the Category view
Follow these steps to create a view to display documents using the Category form.
Step Action Result
1 Open the Policies and Procedures database in Designer.
The database opens in the Work pane.
2 In the Design Pane, click Views.
3 In the Work pane, click New View. The Create View box opens.
4 Name the view, Categories. Click OK.
The Categories view appears in the view list.
5 Open the Categories view. The Categories view opens in the Work pane.
6 Click Add Condition in the View Programmer’s Pane.
The Add Condition dialog box opens.
7 Select By Form from the Condition drop-down list.
A list of the forms in the Policies and Procedures database appears.
8 Select the Category form. Click Add.
Uses ‘Category’ form appears in the Programmer’s Pane.
9 Double click the first view column to open the Column Properties box. Modify the column as follows: � Name: Category � Width: 25
The default column displays Category in its header and is 25 characters wide.
10 In the Programmer’s pane, select Field. Select Category from the list of fields in the database.
The Category column displays the content of Category field.
11 Save and preview the view.
A � 20 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 7: Compute a List of Choices for a Field...(continued)
Modify the Policy form
To build a list of keyword choices from the Category view, do the following:
Step Action Result
1 Open the Policy form in Designer. The form appears in the Work pane.
2 Highlight the Category field and open the Field properties box.
The Field properties dialog box opens.
3 Click the Control tab.
4 In the Choices dialog box, select Use formula for choices in the first dialog box.
5 In the Choices dialog box, enter the following formula in the formula window: lutype := “Notes”:”NoCache”;
db := @DbName;
View := “Categories”;
col := 1;
keylist := @DbColumn(lutype; db; view; col);
@If(@IsError(keylist); “No Entries in view”; keylist)
6 Save and test the form.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 21
PreviewAppendix A � Exercise Solut ions
Lesson 7: Create Reusable Code
Use @ThisValue and @ThisName to create two input validation formulas. Perform these steps to complete the Guided Practice.
Step Action Result
1 In the Practice database, open the Employee Information form in Designer.
The Employee Information form opens in the Work pane.
2 Select the FirstName 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 your "+ @ThisName+".");@Success)
The formula returns the message, “Please enter your FirstName” if the field is left empty.
4 Reuse this formula by copying it and pasting it as an Input Validation formula for the LastName field.
The formula returns the message, “Please enter your LastName” if the field is left empty.
5 In the Salary field, enter the following formula: @If(@ThisValue="";@Failure( "The "+@ThisName+"field must contain a value.");@Success)
The formula returns the message, “The Salary field must contain a value” if the field is left empty.
6 Save and preview the form in Notes.
A � 22 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 8: Create Question and Answer Forms in the Policies Database
This solution consists of the following parts:
� Use a layer and the mod_menu_background.gif file to enhance the look of the forms.
� Design and create the Question form.
� Design and create the Answer form.
Create the header subform
Follow these steps to create the header subform.
Step Action Result
1 Open the Policies database in Designer.
2 In the Design pane, select Shared Code ÆSubforms.
A list of current subforms appears in the Work pane.
3 Click New Subform. A blank subform opens in the Work pane.
4 With the cursor in the Info page, choose CreateÆ Table
The Create Table box opens.
5 Create a fixed width table with 1 row and 2 columns. Click OK.
A table with 1 row and 2 columns is created.
6 Click in the left cell and choose Create ÆImage Resource.
The Image Resource box opens.
7 Select the LOGO WW1.gif file and click OK.
The Worldwide logo is added to the first cell.
8 Click in the right cell and enter the following text: 123 Worldwide Blvd.
Metropolis, PA 45555
Worldwide’s address appears below the company logo.
9 Click below the table and choose Create ÆInsert Resource. Select bluerule.gif and click OK.
The bluerule.gif image is added below the table.
10 Close and save the subform as Worldwide Header.
The subform closes and Worldwide Header appears as an available subform in the subforms list.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 23
PreviewAppendix A � Exercise Solut ions
Lesson 8: Create Question and Answer Forms in the Policies Database...(continued)
Create a shared image
Follow these steps to add a shared image.
Step Action Result
1 Click Shared Resources in the Design list.
2 Click Images. A list of shared images appears in the Work pane.
3 In the Work pane, click the New Image Resource button.
The New Image Resource dialog box opens.
4 In the New Image Resource dialog box, browse for and select the following image files: � mod_menu_background.gif Click Open.
The image is added to the shared resources list.
A � 24 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 8: Create Question and Answer Forms in the Policies Database...(continued)
Create the Question form
Follow these steps to create the Question form.
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 In the Design pane, click Forms. In the Work pane, the list of existing forms appears. The New Form button appears on the button bar.
3 In the Work pane, click New Form.
4 Choose Design Form ÆProperties
The Form properties box opens.
5 Enter Question in the Name field.
Question appears in the name box.
6 Close the properties box.
7 Choose Create ÆInsert Subform. The Insert Subform box opens.
8 Select Worldwide Header. Click OK.
The subform is inserted at the top of the Question form.
9 Click below the subform and enter the following text: Question
10 Position the cursor several spaces below the text and choose CreateÆ Table.
The Create Table box opens.
11 Create a table with 5 rows and 2 columns. Click OK.
A table is inserted on the Question form.
(continued on next page...)
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 25
PreviewAppendix A � Exercise Solut ions
Lesson 8: Create Question and Answer Forms in the Policies Database...(continued)
Create the Question form, continued
Follow these steps to continue creating the Question form.
Step Action Result
12 In the first row add the following filed label into the left cell and field into the right cell: Field label: Name: Field name: UserName, Field type: Text, Computed
The first row is populated with a field label and field.
13 In the Programmer’s pane, enter the following formula: @UserName
14 Repeat step 12 in the next row with the following changes: Field label: Date of Question Field name:QuestionDate Field type:Date/TIme, Computed
The row is populated with a field label and field.
15 In the Programmer’s pane, enter the following formula: @Created
16 Repeat step 12 in the next row with the following changes: Field label:Category
The row is populated with a field label and field.
17 In the right cell choose InsertÆ Shared Field. Select Category.
The Category shared field is inserted in the right cell.
18 Repeat step 12 in the next row with the following changes: Field label: Subject Field name: Subject Field type: Text, Editable
The row is populated with a field label and field.
(continued on next page...)
A � 26 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 8: Create Question and Answer Forms in the Policies Database...(continued)
Create the Question form, continued
Follow these steps to continue creating the Question form.
Step Action Result
19 Repeat step 12 in the next row with the following changes: Field label: Details Field name: Details Field type: Rich Text, Editable
The row is populated with a field label and field.
20 Click outside the table. Choose Create ÆLayer.
A blank layer is inserted on the form.
21 Choose Layer ÆLayer properties. Set the z-index to 0
The layer is positioned behind the table.
22 Click the Layer Background tab. Click Browse Images and select the mod_menu_background.gif image. Click OK.
The mod_menu_background.gif image is added to the layer.
23 Set the image to Repeat horizontally.
24 Resize the layer by clicking and dragging one of the layer corners. Position it behind the table of field labels and fields.
The layer serves as a background to the table.
25 Save and close the Question form.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 27
PreviewAppendix A � Exercise Solut ions
Lesson 8: Create Question and Answer Forms in the Policies Database...(continued)
Create the Answer form
Follow these steps to create the Answer form. This form will inherit information from the Question form.
Step Action Result
1 Open the Policies database in Designer.
2 In the Design pane, click Forms. In the Work pane, the list of existing forms appears. The New Form button appears on the button bar.
3 In the Work pane, click New Form.
4 Choose Design Form ÆProperties
The Form properties box opens.
5 Enter Answer in the Name field. Select Response as the form Type.
Answer appears in the name box.
6 Click the Defaults tab and select On Create Formulas inherit values from selected document. Close the Properties box.
When a document is created using the form it will inherit values from another document.
7 Choose Create ÆInsert Subform. The Insert Subform box opens.
8 Select Worldwide Header. Click OK.
The subform is inserted at the top of the Question form.
9 Click below the subform and enter the following text: Answer
10 Position the cursor several spaces below the text and choose CreateÆ Table.
The Create Table box opens.
11 Create a table with 5 rows and 2 columns. Click OK.
A table is inserted on the Answer form.
(continued on next page...)
A � 28 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 8: Create Question and Answer Forms in the Policies Database...(continued)
Create the Answer form, continued
Follow these steps to continue creating the Answer form.
Step Action Result
12 In the first row add the following filed label into the left cell and field into the right cell: Field label: Name: Field name: UserName, Field type: Text, Computed
The first row is populated with a field label and field.
13 In the Programmer’s pane, enter the following formula: UserName
The field derives its value from the UserName field.
14 Repeat step 12 in the next row with the following changes: Field label: Question Subject Field name: QuestionSubject Field type:Text, Computed
The row is populated with a field label and field.
15 In the Programmer’s pane, enter the following formula: Subject
The field derives its value from the Subject field
16 Repeat step 12 in the next row with the following changes: Field label: Date of Question Field name:QuestionDate Field type:Date/TIme, Computed
The row is populated with a field label and field.
17 In the Programmer’s pane, enter the following formula: @Created.
.
18 Repeat step 12 in the next row with the following changes: Field label: Answer Subject Field name: AnswerSubject Field type: Text, Editable
The row is populated with a field label and field.
(continued on next page...)
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 29
PreviewAppendix A � Exercise Solut ions
Lesson 8: Create Question and Answer Forms in the Policies Database...(continued)
Create the Answer form, continued
Follow these steps to continue creating the Answer form.
Step Action Result
19 Repeat step 12 in the next row with the following changes: Field label: Answer Field name: Answer Field type: Rich Text, Editable
The row is populated with a field label and field.
20 Click outside the table. Choose Create ÆLayer.
A blank layer is inserted on the form.
21 Choose Layer ÆLayer properties. Set the z-index to 0
The layer is positioned behind the table.
22 Click the Layer Background tab. Click Browse Images and select the mod_menu_background.gif image. Click OK.
The mod_menu_background.gif image is added to the layer.
23 Set the image to Repeat horizontally.
24 Resize the layer by clicking and dragging one of the layer corners. Position it behind the table of field labels and fields.
The layer serves as a background to the table.
25 Save and close the Answer form.
26 Create several the Question and Answer forms.
A � 30 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 9: Display the Question and Answer Forms in a View
Follow these steps to create a hierarchical view that displays the Questions with the answer below.
Step Action Result
1 Open the Policies and Procedures database in Designer.
The database opens in the Work pane.
2 In the Design Pane, click Views.
3 In the Work pane, click New View. The Create View box opens.
4 Name the view, Q & A. Click OK. The Categories view appears in the view list.
5 Open the Q & A view. The Categories view opens in the Work pane.
6 Select View Selection in the Objects pane.
The Add Condition dialog box opens.
7 In the Programmer’s pane, select Formula in the Run dropdown list.
SELECT @All appears in the Programmer’s pane.
8 Delete SELECT @All. Enter the following formula: SELECT Form=”Answer”
The new formula is created.
9 Double click the first view column to open the Column Properties box. Modify the column as follows: � Name: Question � Width: 25
10 In the Programmer’s pane, select Formula and add the following formula: Subject + " - " + @Text(QuestionDate)
The Question column displays the content of the Subject and QuestionDate fields.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 31
PreviewAppendix A � Exercise Solut ions
Lesson 9: Display the Question and Answer Forms in a View...(continued)
Create a responses only column
Follow these steps to create a responses only column in the Q & A view .
Step Action Result
1 Open the Q & A view in Designer.
2 Choose Insert ÆNew Column to create a column to the left of the Question column.
A new blank column is inserted in front of the Question column.
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 In the Programmer’s pane, select Formula and add the following formula: AnswerSubject + " - " + @Text(AnswerDate)
5 Save and preview the view.
A � 32 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 10: Adding Automation to the Policies Application
This solution consists of the following parts:
� Create a list of actions. Determine where they need to be executed and if they are shared.
� Create the actions.
� Add the actions to the appropriate views and forms.
� Hide the actions when appropriate.
� Save any of the documents by clicking a button instead of using menu commands.
List of actions
The following table lists the actions that need to be added to the Policies database.
Action Where used
Create Policy Policies View
Edit Policy Policies View When policy document is open in read mode.
Create Question Q&A View Policies View
Edit Question Q&A View When question document is open in read mode.
Create Answer Q&A View When question document is open in read mode.
Edit Answer Q&A View When answer document is open in read mode.
Save and close the document.
Q&A View Policies View When policy, question or answer document is open in edit mode.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 33
PreviewAppendix A � Exercise Solut ions
Lesson 10: Adding Automation to the Policies Application... (continued)
Create the Create Policy button
Follow these steps to create the Create Policy button.
Step Action Result
1 Open the Policies view, from the Policies database, in Designer.
The view appears in the Programmer’s pane.
2 Choose Create➞Action from the menu.
The Action properties box opens.
3 In the Name dialog box, enter Create Policy.
The action is named Create Policy.
4 Enter the following formula in the Script area for the Click object of the action: @Command( [Compose];"Pol-icy")
The formula appears in the Script area.
5 Save and close the form.
A � 34 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 10: Adding Automation to the Policies Application... (continued)
Create shared actions
Follow these steps to create the shared actions.
Step Action Result
1 With the Policies database open in Designer, click Shared Code➞Actions.
The Work pane opens to the shared actions list.
2 Click New Shared Action. The Shared Action Properties box opens.
3 In the Name box, enter Edit Document.
The shared action is named Edit Policy.
4 Select the Action Hide/When tab.
The Action Hide/When tab appears.
5 Select � Previewed for editing � Opened for editing.
The properties are set which will hide the button if the document is in Edit mode.
6 Close the Action properties box.
7 Enter the following formula in the Script area for the Click object of the action: @Command([EditDocument])
The formula appears in the Script area.
8 Save the shared action.
(continued on next page...)
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 35
PreviewAppendix A � Exercise Solut ions
Lesson 10: Adding Automation to the Policies Application... (continued)
Create shared actions
Follow these steps to create more shared actions.
Step Action Result
9 Repeat steps 1-6 with the following change: Name: Create Answer
The Create Answer action is created.
10 Enter the following formula in the Script area for the Click object of the action: @Command ( [Compose]; "Answer" )
Note: Use the form alias if you created one, in place of the form name.
The formula appears in the Script area.
11 Save the shared action.
12 Repeat steps 1-6 with the following change: Name: Create Question
The Create Question action is created.
13 Enter the following formula in the Script area for the Click object of the action: @Command([Compose];"Question" )
The formula appears in the Script area.
14 Save the shared action.
A � 36 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 10: Adding Automation to the Policies Application... (continued)
Insert the shared action onto the forms
Follow these steps to insert the shared actions in the appropriate forms.
Step Action Result
1 Open the Answer form in Designer.
The form appears in the Programmer’s pane.
2 Choose Create➞Insert Shared Action from the menu.
The Insert Shared Action dialog box appears.
3 Select the Edit Document shared action.
Designer adds the shared action to the form.
4 Click Done. The Insert Shared Action dialog box closes.
5 Save and close the Answer form.
6 Repeat steps 1 - 5 to insert the Edit Document shared action onto the Policy and Question forms.
The Edit Document action appears on the two additional forms.
Insert the shared actions onto the views
Follow these steps to insert the shared actions in the appropriate views.
Step Action Result
1 Open the Policies view in Designer.
The view appears in the Programmer’s pane.
2 Choose Create➞Insert Shared Action from the menu.
The Insert Shared Action dialog box appears.
3 Select the Edit Document and Create Question shared actions.
Designer adds the shared actions to the view.
4 Click Done. The Insert Shared Action dialog box closes.
(continued on next page...)
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 37
PreviewAppendix A � Exercise Solut ions
Lesson 10: Adding Automation to the Policies Application... (continued)
Insert the shared actions onto the views, continued
Follow these steps to insert the shared actions in the appropriate views.
Step Action Result
5 Save and close the Policies view.
6 Repeat steps 1 - 5 to insert the following shared actions onto the Q & A view: � Edit Document � Create Question � Create Answer
The shared actions appear on the Q & A view.
A � 38 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 10: Adding Automation to the Policies Application... (continued)
Create the Save and Close button
Follow these steps to create the Save and Close button.
Step Action Result
1 With the Policies database open in Designer, click Shared Code➞Actions.
The Work pane opens to the shared actions list.
2 Click New Shared Action. The Shared Action Properties box opens.
3 In the Name box, enter Save and Close.
The shared action is named Save and Close.
4 Click the Action Hide/When tab. The Action Hide/When tab appears.
5 Select Previewed for reading and Opened for reading.
The properties are set which will hide the button if the document is in Read mode.
6 Close the Shared Action properties box.
7 Enter the following formula in the Script area for the Click object of the action: @Command([FileSave]);
@Command([
FileCloseWindow])
The formula appears in the Script area.
8 Save the shared action.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 39
PreviewAppendix A � Exercise Solut ions
Lesson 10: Adding Automation to the Policies Application... (continued)
Add the Save and Close shared action to the forms and views
Follow these steps to add the Save and Close shared actions to the forms and views in the Policies application.
Step Action Result
1 Open the Answer form in Designer.
The form appears in the Programmer’s pane.
2 Choose Create➞Insert Shared Action from the menu.
The Insert Shared Action dialog box appears.
3 Select the Save and Close shared action.
Designer adds the shared action to the form.
4 Click Done. The Insert Shared Action dialog box closes.
5 Save and close the Answer form.
6 Repeat steps 1 - 5 to insert the Save and Close shared action onto the Policy and Question forms.
The Save and Close action appears on the two additional forms.
7 Open the Policies view in Designer.
The view appears in the Programmer’s pane.
8 Choose Create➞Insert Shared Action from the menu.
The Insert Shared Action dialog box appears.
9 Select the Save and Close shared action.
Designer adds the shared action to the view.
10 Save the view.
11 Repeat steps 7-10 to insert the Save and Close shared action onto the Q & A view.
A � 40 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 11: Update Existing Documents
Follow these steps to create an agent that re-assigns the policy numbers.
Step Action Result
With the Policies database open in Designer, click Shared Code➞Agents.
The Work pane opens to the agents.
2 Click New Agent. The Agent Properties box opens in the Work pane.
3 In the Name dialog box, enter Re-Assign Policy Numbers.
The agent is given a name.
4 Check that Shared is selected. The agent is designated as a shared agent.
5 In the Programmer’s pane, select Formula from the Run list.
The Programmer’s pane is split into the InfoList and the Script area.
6 In the Script area, enter the following formula: REM {Generate a random number};
TempNum := @Random * 100;
REM {Select the rightmost 4 digits of the number to use in the policy number};
REM {and make it text.};
NewTemp := @Right(@Text(TempNum);4);
REM {Set the PolicyNO field to "PN" plus the NewTemp};
FIELD PolicyNo := "PN" + NewTemp;
SELECT @All
The formula is entered in the Script area.
7 Save the agent. The new agent is saved.
8 Open the database in the Notes client, run the agent, and check the results.
The PolicyNo field in all Policy documents contains the reassigned policy numbers.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 41
PreviewAppendix A � Exercise Solut ions
Lesson 12: Set Access Restrictions to the Database
The following table lists the access restrictions for the Policies application.
User/Group Privileges
Default Depositor
Anonymous No Access
Employees Author
Policy Makers Editor
Department Head Author
Managers Manager
Designer Designer
A � 42 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 13: Create Roles
The following solution consists of two parts:
� Determine the roles for the Policies application
� Create the roles
Determine the roles
The following table lists the roles for the Policies application.
Role Description
Employees Employee
PWriters Policy and Procedure Writer
Designers Database Designer
Managers Manager
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 43
PreviewAppendix A � Exercise Solut ions
Lesson 13: Create Roles...(continued)
Create the roles
Follow these steps to create the roles from the preceding table.
Step Action Result
1 Open the Policies application in Designer.
2 Choose File ÆDatabase ÆAccess Control.
The Access Control List to: Policies and Procedures box opens.
3 Click the Roles tab located on the left side of the Access Control List dialog box.
The roles field opens in the Access Control box.
4 Click Add to add a user Role. The Add Role box opens.
5 Enter Employees in the Add Role dialog box. Click OK.
Employees appears, in brackets, in the Roles list.
6 Repeat steps 3 and 4 to add the following roles: � PWriters � Designers � Managers
The new roles are added to the Roles list.
7 Click the Basics icon located on the left side of the Access Control List dialog 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.
A � 44 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 13: Control access to documents in the Policies and Procedures application
In this exercise you will control access to documents in the Policies and Procedures application based on the following:
� All employees should be able to read any document in the application.
� Prevent users not in the Group/Users listed in the ACL from accessing the application.
� Only people in the PWriters role should be able to create Policy documents.
� All employees can create Question documents.
� Only the person who creates a Question should be able to modify it.
� Only PWriters should be able to create and edit Answers.
The following solution consists of the following several parts:
� Change the ACL to modify the access rights of different groups of users
� Change the Policy form to allow only users assigned the PWriters role to create or edit documents created with this form
� Change the Question form so only the author can edit their question
� Change the Answer form to allow only users assigned the PWriters role to create or edit documents created with this form
� Set the hide/when formula for actions
This solution assumes the database has the groups and roles from the previous two exercises.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 45
PreviewAppendix A � Exercise Solut ions
Lesson 13: Control Access to Documents in the Policies and Procedures Application...(continued)
Modify the ACL
Follow these steps to modify the Policies and Procedures database ACL to set the access levels of the Employee group and the [PWriter] role.
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 Choose File ÆDatabase ÆAccess Control.
The Access Control List to: Policies and Procedures box opens.
3 Select the Employee group from the list of users.
The Employee group is highlighted.
4 Select the Create documents access privilege.
Users in the Employee group have the Create Document privilege Author privileges and are assigned the Employees role.
5 Select the Policy Makers group from the list of users.
The Policy Makers group is highlighted.
6 Select Author as the access level. Select the [PWriter] role.
Users in the Policy Makers group have Author privileges and are assigned the [PWriter] role.
7 Select the Department Heads group from the list of users. Assign the [PWriter] role to the group.
Users in the Department Heads group are assigned the [PWriter] role.
8 Click OK to close the Access Control List box and save the database.
A � 46 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 13: Control Access to Documents in the Policies and Procedures Application...(continued)
Set the default access
Follow these steps to change the access rights of default users to no access.
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 Choose File ÆDatabase ÆAccess Control.
The Access Control box opens.
3 Click -Default- from the list of users.
4 Select Reader as the access level. Deselect Write Public Documents. Click OK.
Anyone with default access to the database can read documents.
Place restrictions in the Policy form
Follow these steps to restrict who can create and edit documents created with the Policy form.
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 In the Design pane, expand the list of Forms. Open the Policy form.
The Policy form opens in the Work pane.
3 Deselect All Authors and above for Who can create documents with this form. Select the [PWriters] role. Close the Form Properties box.
Only users assigned the PWriters role can create Policies.
(continued on next page...)
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 47
PreviewAppendix A � Exercise Solut ions
Lesson 13: Control Access to Documents in the Policies and Procedures Application...(continued)
Place restrictions in the Policy form, continued
Follow these steps to restrict who can create and edit documents created with the Policy form.
Step Action Result
4 Create an Authors field in the Policy Form with the following properties: � Name: Editors � Data type: Authors � Type: Computed when
composed � Allow multiple values � Value formula: @IsMember("[PWriter]":@UserNa me)
Only users assigned to the PWriter role can create a Policy document.
5 Save the form.
A � 48 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 13: Control Access to Documents in the Policies and Procedures Application...(continued)
Modify the Question form
Follow these steps to set the read and edit restrictions for the Question form.
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 Open the Question form.
3 Create an Authors field with the following properties: � Name: Authors � Data type: Authors � Type: Computed when
composed � Value formula: @UserName
Only the document’s creator can make changes to the document.
4 Save and close the form.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 49
PreviewAppendix A � Exercise Solut ions
Lesson 13: Control Access to Documents in the Policies and Procedures Application...(continued)
Modify the Answer form
Follow these steps to modify the Answer form so only users assigned the [PWriter} role can create and edit documents created with the form.
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 Open the Answer form. The Answer form opens in the Work pane.
3 Choose Design ÆForm properties. Select the Security tab.
The Form Properties box opens.
4 Deselect All Authors and above for Who can create documents with this form. Select the [PWriters] role. Close the Form Properties box.
Only users assigned the PWriters role can create Answers.
5 Place your cursor at the bottom of the form and choose Create Æ Field.
Only the document’s creator can make changes to the document.
6 Create an Authors field with the following properties: � Name: Authors � Data type: Authors � Type: Computed when
composed � Value formula: @UserName
7 Save and close the form.
A � 50 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 13: Control Access to Documents in the Policies and Procedures Application...(continued)
Set hide/when formula for shared actions
Follow these steps to set the hide/when function for the Create Policy and Create Answer actions.
Step Action Result
1 With the Policies database open in Designer, click Shared CodeÆActions.
The Work pane opens to the shared actions list.
2 Open the Create Answer action.
3 Choose Design ÆShared Action Properties. Click the Action Hide When tab.
The Shared Action Properties box opens.
4 Select Hide action if formula is true and enter the following formula: @IsMember("[PWriters]"; @UserRoles)
The Create Answer action is hidden from anyone who is not assigned the PWriters role.
5 Save the shared action.
6 Repeat steps 1- 5 for the Create Policy shared action.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 51
PreviewAppendix A � Exercise Solut ions
Lesson 14: Create a design template and a new database
The following solution has three parts:
� Extract the design elements to create a master design template.
� Create a master design template
� Create a new database which will update whenever the template changes
Extract design elements
Follow these steps to extract the design elements to another database which will become the master design template.
Step Action Result
1 Select the Policies and Procedures database in either Notes or Designer.
2 Choose File Æ Database Æ New Copy.
The Copy Database box opens.
3 Make sure that the server is set to Local.
4 Enter the title Policies_Template.
5 Enter the file name Policies_Template.NTF.
Note: The NTF file extension does not make the file a template. It simply causes it to appear as a choice in the list of templates when you create a new database.
6 Click Copy: Database design only.
Only the database design elements will be copied, not the documents.
7 Click OK. The database design is copied locally.
A � 52 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix A � Exercise Solutions
Lesson 14: Create a Design Template and a New Database... (continued)
Turn a database into a template
Follow these steps to turn the Policies_Template database into a template.
Step Action Result
1 Open the Policies_Template.ntf database in Designer
2 Choose File ÆDatabase Properties to open the Properties box.
The Database Properties box opens.
3 Click the Design tab.
4 Select Database file is a master template.
5 Enter the template name Policies_Template.ntf.
The template name is the link between the template and the database or databases. Click the green check mark.
The template name is listed in the name box.
6 Save the database.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls A � 53
PreviewAppendix A � Exercise Solut ions
Lesson 14: Create a Design Template and a New Database... (continued)
Linking the application database to the master design template
Once you create the master design template, follow these steps to link it to your application database:
Step Action Result
1 Open the Policies and Procedures database in Designer.
2 Choose File ÆDatabase Properties.
The Policies application Properties box opens.
3 Click the Design tab.
4 Select Inherit from template. Click in the Template Name box and enter Policies_Template.ntf
The Policies and Procedures database will inherit design changes from the Policies_Template.ntf database.
5 Make changes to the Policies_Template.ntf database and refresh the design of the Policies and Procedures database to see if the changes occur.
A � 54 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
BAppendix
Identifying Programming Languages Supported by Domino
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Writing Programs in Domino
You can write programs in a Domino application using the Designer client. Many design elements can execute programs automatically through the properties and events of the element.
You can also write programs outside the Domino application using other development tools. These programs can be imported or run in the operating system to access the Domino application.
Domino is a flexible development environment
The Domino development environment supports all leading technologies withtools that cater to varying developer skill levels and degrees of programming experience. Given so many choices, the question that confronts developers at the outset of any application development initiative is which tool to use. The answer issimple: Understand the functions that can be performed programmatically inDomino, then pick the one that meets the demands of the task at hand and whichis most comfortable for you. Some factors that affect the decision include:
� Does the code run 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?
Just as important as where the code is written is where it is executed. The locationof execution, i.e., server versus client, can affect how the data is accessed, aswell as the security provisions that are taken to protect the data.
B � 2 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Writing Programs in Domino...(continued)
Where to program in Domino
The following diagram shows where code can be written for the Domino environment.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls B � 3
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Writing Programs in Domino... (continued)
Internal programming languages
Domino Designer provides an Integrated Development Environment (IDE) for writing code in a Domino application. It supports the following four programming languages:
� Formula
� LotusScript
� Java
� JavaScript
Domino also supports HTML and XML.
External programming languages
Domino supports the following external programming languages:
� Java
� C, C++
� Visual Basic
Connecting to Domino from external applications
The following table describes the two database drivers that allow you to query Domino databases via SQL.
This Driver Is... Use It When You Require...
NotesSQL An ODBC driver that makes Domino databases look like another relational back-end source to an SQL tool or application interface.
Read/write access to Lotus Domino data using any application that supports ODBC. For example, an application that produces reports in Notes using Seagate’s Crystal Reports or Microsoft Access.
Lotus Domino Driver for JDBC
A Type II JDBC driver that makes Domino databases look like another relational back-end source to an SQL tool or application interface.
Access to Lotus Domino data using any JDBC-enabled application. For example, when your application is a servlet on an HTTP server.
B � 4 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Examining the Formula Language
The Formula language is the core language built into Notes/Domino from its earliest releases. You will learn more about working with the Formula language in the next two lessons.
Where to use the Formula language
The Formula language consists of @functions and @commands. Use @functions and @commands to customize the forms, fields, and views of a Domino application. The following table lists common events and properties that execute formulas.
Element Property/Event
Form � Window Title
� WebQuerySave
� PostOpen (can also execute LotusScript)
Field � Value or Default Value
� Input Validation
� Input Translation
� Hide/when
View � View Selection
� Form Formula
� Column Formula
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls B � 5
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Examining LotusScript
LotusScript is an embedded BASIC scripting language that offers access to Domino data and services beyond the capabilities of the Formula language.
Where to use LotusScript
Use LotusScript to program agents and actions or to execute code in a design element event. The following table lists common events that execute LotusScript.
Element Property/Event
Form Postopen (can also execute formulas)
Queryclose
Postrecalc
Field Initialize
Terminate
Agent Initialize
Terminate
Criteria for selecting LotusScript
The following table summarizes the advantages and limitations of using LotusScript.
Advantages Limitations
Embedded BASIC language
Object-based
Sophisticated access to Domino data
Integrated debugger
Requires programming skills
More verbose than formula language
Not executable in Web browsers
B � 6 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Examining Java
Internally, Domino only supports the use of Java in agents. However, external Java programs can access Domino applications.
The Designer IDE provides a basic Java editor in the Agent Builder, with color formatting and reference Help for the standard Java language and the Domino classes.
Where to use Java
Use the 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 stand-alone applications that access Domino applications.
Criteria for selecting Java
The following table summarizes the advantages and limitations of using Java.
Advantages Limitations
� Powerful object-oriented language
� Remote access and networking support
� Extensive class library (beyond Domino)
� Multi-threaded
� Internally, Domino only supports its use in agents.
� Complex program development requires third-party development tool with debugger.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls B � 7
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Examining JavaScript
JavaScript is integrated in Designer to allow Domino applications to support users with Web browsers. The Notes 6 client interprets JavaScript and thus benefits from its unique characteristics. This functionality is critical in building applications for mixed clients.
Where to use JavaScript
Use the Programmer’s pane to write JavaScript directly into properties and events of forms, pages, and their design elements. The following table lists common properties and events that execute JavaScript.
Element Property/Event
Form or Page � JSHeader
� onLoad
� onUnload
Field or Button � onFocus
� onBlur
� onChange
� onMouseOver
Criteria for selecting JavaScript
The following table summarizes the advantages and limitations of using JavaScript.
Advantages Limitations
� Object-based language
� Web standard
� Cross-platform compatibility
� Runs in Notes clients and Web browsers
� Built-in editor, but no debugger
� Requires programming skills
B � 8 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix B � Identifying Programming Languages Supported by Domino
Choosing a Language
Choosing the best language to use for a given situation can be complex. Many times, the requirements of the situation will narrow the number of choices available.
Criteria for choosing a language
The following table outlines some of the guidelines you can use to make a programming language choice.
If the Application Requires...
Consider Choosing...
Complex control LotusScript, Java, JavaScript
User interaction Formula, LotusScript, JavaScript
Access to Domino data LotusScript, Java, Formula
Calculations with simple results
Formula
A series of scripted activities
LotusScript, JavaScript
Data access efficiency LotusScript, Java, Formula
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls B � 9
PreviewAppendix B � Identifying Programming Languages Supported by Domino
B � 10 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
CAppendix
Learning Processes and Instructor Guide Conventions
© Copyright IBM Corporation 2002. All r ights reserved.
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes
This section includes the relevant information about the standard curriculum development learning processes and icons. Use this section as a tool to prepare to deliver the course successfully.
Note: The terms instructional unit and unit are used to refer to general units of instruction, including modules, lessons, topics, activities, and so on.
What are learning processes?
Learning processes are the basic instructional strategies that the instructor usesto encourage students to achieve learning objectives. Presentation, Discussion, Demonstration, Guided Practice, and other delivery strategies provide the means for facilitating instruction and skills acquisition. A unique icon indicates the recommended learning process and displays next to the learning process instruction.
For the learning processes that follow, you will see:
� A summary description
� The appropriate icon
� A table indicating what the instructor and students will see in their guides
� Teaching tips
Note: Not all the learning processes are used in every course.
What is e-learning?
Some of the descriptions that follow include references to e-learning. E-learning education offerings and seminars are delivered using online tools. E-learning courseware can be self-paced or instructor-led. Instructor-led e-learning courses use the tools of either the Lotus® Sametime® Meeting Center or the Lotus® LearningSpace® Virtual Classroom.
C � 2 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Assessment
An Assessment is an evaluation learning process used to gauge the student'sknowledge. Assessments provide feedback to both the student and instructor,and can be formal or informal. Assessments can be collected and graded, or assessment answers are provided.
Assessments are used to:
� Assess prior knowledge (pre-test).
� Provide self-assessment.
� Calculate the course grade.
� Verify attainment of course learning goals.
The following table lists the supporting materials that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Assessment icon � Questions � Answers � For Lotus LearningSpace materials,
reference to the Question Set or assessment that was enabled for the session.
� Assessment icon � Answers
Note: Answers to the assessments are included in the Assessment Answers appendix of both the Student Guide and Instructor Guide.
Teaching tips
9 Clearly state the purpose of the assessment (for example, to provide self-assessment, assess prior knowledge, or calculate course grade).
9 When applicable, provide information on the organization's policies regarding grading and privacy of information.
9 When delivering an e-learning question, allow for transmission time before tallying answers.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls C � 3
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Case Study
A Case Study is an experience-based learning process used for discovery and exploration, or as a culmination of learning objectives.
The Case Study presents a problem or scenario. Students work independently or in groups to provide recommendations, problem resolutions, or solution strategies. Although Case Study materials may not include a correct answer, they may include recommended solutions, a list of considerations, or resolution strategies.
The following table lists the supporting information that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Case Study icon � Presentation strategy � Workgroup recommendations � Solution methodology � Estimated timing for student work � Possible solutions, considerations, or
strategies � Estimated timing for discussion � Discussion tips
� Case Study icon � Facts and scenario of case � Problem to be solved � Possible solutions, considerations, or
strategies
Teaching tips
9 Follow the recommended timing for the case study, but modify accordingly based on the students’ expertise.
9 Lead a discussion on a recommended solution.
9 Discuss the solution(s) and, as a group, list the advantages and disadvantages of the suggested alternatives.
C � 4 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Demonstration
A Demonstration is a presentation of a procedure, user interface, solution, or other course-related task or structure. In general, instructors use Demonstrations to present content, procedures, and structure.
Students watch but do not participate in Demonstrations.
Demonstrations can be used to:
� Present complex material.
� Illustrate a new topic.
� Present a topic quickly, without presenting it in detail.
� Provide a change of pace within the course.
� Implement specific parts of the classroom scenario.
The following table lists the supporting information that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Demonstration icon � Instructions (and, if applicable, data) an
instructor uses to perform a particular Demonstration
� Specific content information that should be presented
� For e-learning materials, instructions to transition to the Screen Sharing mode
� Procedure icon � When appropriate, the related generic
Procedure or information related to the task being demonstrated.
Demonstration database
For some offerings, a Demonstration database is included on the Classroom Tools media. Sample Demonstrations are pre-built for the instructor to use.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls C � 5
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Teaching tips
9 Relate the Demonstration to the information or Procedure in the Student Guide.
9 Ask questions during the Demonstration to ensure student comprehension of the task or information referenced in the demonstration.
9 Consider directing the students to look at the Procedure after completing the demonstration to help ensure that the students watch the instructor perform the steps.
9 For e-learning delivery, use Screen Sharing and enable participants to complete some procedural tasks.
C � 6 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Discussion
A Discussion is an interactive activity in which the instructor solicits opinions,ideas, beliefs, and experience regarding course-related content or issues.Discussions can be used to:
� Solicit analogies from student experiences.
� Introduce a new topic or sequence that builds on existing skills or knowledge.
� Ascertain general understanding or assimilation of course content.
The following table lists the supporting information that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Discussion icon � Questions to ask students and ideal
answers to the questions � Important information or ideas that
could result from the Discussion � Transition statements to begin or
summarize discussion � For e-learning materials, tips or
alternatives for conducting the Discussion with a large or distributed student group
� Related procedure or information
Teaching tips
9 Limit the Discussion to topics directly related to the lesson objective.
9 Ask questions to encourage participation.
9 Summarize the Discussion to help students relate the topics discussed with the course content.
9 For e-learning delivery, use the hand raise tools, chat, and poll techniques to solicit feedback.
9 For e-learning delivery, in sessions that do not use online audio, encourage students to use the electronic hand raise feature to indicate that they would like to participate.
9 For e-learning delivery, remind students to state their name before speaking, to identify themselves to classmates who might not recognize their voice.
9 For e-learning delivery to large groups, consider conducting the discussion using other means, for example, Chat or Discussion Board.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls C � 7
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Exercise
There are two types of exercises: online and paper-based.
Online Exercise icon
Students complete the exercise on the computer.
Paper-based Exercise icon
Students complete the exercise on paper.
An Exercise is a problem-solving learning process, which can provide immediate positive feedback when successfully completed. Exercises challenge students to use the skills they have learned in an instructional unit.
Exercises may occur in the middle or at the conclusion of a unit.
Exercises do not provide instructions for completion. Instead, they provide a set of criteria, a problem statement, or general task that students use to develop a working solution for a specific goal.
Note: Solutions to Exercises are included in Appendix A: Exercise Solutions of both the Student Guide and Instructor Guide.
The following table lists the supporting information that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Exercise icon � Estimated timing for the Exercise � Recommendations on how students
should perform the Exercise, such as working in groups or individually
� Special preparation instructions � Tips to help students resolve any
problems that they may encounter � For e-learning materials, instructions for
conducting a small group Exercise using the Breakout Session tools or other methods of collaboration.
� Exercise icon � Facts or scenario � Problem to be solved � Goal to be achieved � Task to complete � Criteria for completion
C � 8 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Teaching tips
9 Refer to any special preparation students must complete, or issues they may encounter during the Exercise.
9 Remain available during the Exercise and be prepared to answer students' questions.
9 Review the Exercise solution in Appendix A: Exercise Solutions at the end of the exercise.
9 Make group assignments clear and achievable.
9 For e-learning delivery that uses the Breakout Session tools, schedule the session as a final class activity, one that does not require students to return to the main live session. This simplifies the navigation that students need to complete.
9 For e-learning delivery where students have little or no experience with Breakout Session tools, assign a teaching assistant to initiate the session and facilitate the group’s work.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls C � 9
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Guided Practice
A Guided Practice is a student-centered learning process that allows students to learn by performing a task. Guided Practices can be instructor-led or self-paced.
� Instructor-led practice is used to present a new procedure or a new user interface.
� The instructor and students perform the procedure at the same time.
� The classroom projection system or monitor displays the instructor’s actions.
� The Student Guide includes detailed instructions for completing the task.
� Self-paced practice allows students to apply a learned skill or knowledge. Students perform a procedure independently, using instructions.
The following table lists the supporting information that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Guided Practice icon � Heading that indicates whether the
Guided Practice should be instructor-led or self-paced
� Preparation directions � Estimated timing for the self-paced
practice � Potential issues � Content details that should be
presented in the instance of an instructor-led practice
� Guided Practice icon � Step/Action or Step/Action/Result table
that contains specific information � Step/Action or Step/Action/Result table
that contains specific tasks to complete
Teaching tips
9 Briefly review the directions before starting the Guided Practice.
9 If the students perform the Guided Practice on their own, be available during the guided practice so they can ask questions.
9 Review the Guided Practice results when completed to ensure that students have successfully completed it or demonstrated comprehension of the skills.
9 Provide additional information as required.
9 Relate the Guided Practice information to the job task whenever possible.
C � 10 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Presentation
A Presentation is an instructor-led learning process used to present content and instruction using a variety of media.
Presentations include:
� Freelance slides
� Multimedia executables
� Videos
� Whiteboard slides for e-learning offerings
� Follow Me pages for e-learning offerings
The following table lists the supporting information that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Presentation icon � Slide title or content � Media for the Presentation � Location of Presentation materials in
the Classroom Tools database or directory
� Estimated timing for the Presentation � Special setup or delivery instructions � Content information to be presented � For e-learning materials, instructions to
share or use Whiteboard Tools � For e-learning materials, Follow Me
page name � For e-learning materials, instructions to
select and send the Follow Me page
� Related Procedure or information � Slide content
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls C � 11
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Teaching tip
9 Keep the Presentation within the scope of the content.
9 Enhance the Presentation using your own words and relate the information to the appropriate objective.
9 For e-learning delivery, use the Whiteboard Tools to annotate the slide and the Whiteboard Pointer tool to focus attention.
9 For e-learning delivery, when displaying a new Whiteboard or Whiteboard slide, pause to allow time for each student's display to refresh.
9 For e-learning delivery, when presenting a Web page, pause to allow the new browser window to open and display the page on the student's machine. When finished presenting the page, instruct students to close the window and display the live session window.
C � 12 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Procedure
A Procedure is a generic task that is documented using step-by-step instructions. Procedures are always presented in a table format.
A Procedure can also be in the form of a checklist. Checklists can be used to list:
� Tasks required to complete a specific objective.
� Tasks that are part of a process.
� Items, equipment, requirements, or other materials necessary to complete a task.
The following table lists the supporting information that may be included in the Instructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� When accompanied by a Demonstration, instructions, such as preparation and specific steps
� The purpose of the procedure as it relates to the subject matter
� Procedure icon � Step/Action or Step/Action/Result table
Teaching tips
9 If the Procedure is related to a Demonstration, direct the students to look at the Procedure after completing the Demonstration. This helps ensure that the students watch the instructor perform the task.
9 For a checklist, periodically review the checklist to show progress in completing a task or process.
9 For a checklist, recommend to students that they use the checklist as a reference.
9 For a checklist, create and present a slide or flipchart containing the checklist. Track the progress of the larger process on this flipchart or slide.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls C � 13
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Processes...(continued)
Review
A Review is used to reiterate main concepts and can be used to gain feedback,assess learning, review critical material, or transition from one instructional unit toanother.
A Review may be used to:
� Review the results of a Guided Practice, Case Study, or Exercise.
� Seek feedback on the pace or level of instruction.
� Provide self-assessment.
� Present assessments that can be stored and graded in e-learning delivery.
� Reinforce content.
The following table lists the supporting information that may be included in theInstructor and Student Guides for this learning process.
Instructor Guide Contents Student Guide Contents
� Review icon � Questions � Answers � Main concepts � For e-learning materials, reference to
the question or assessment that was enabled for the session
� No Student Guide contents
Teaching tips
9 Use questions to review content and not restate objectives.
9 If students exceed the course prerequisites and/or demonstrate mastery of the key concepts, consider excluding some questions.
9 For e-learning delivery, refer to the Course Setup Guide for instructions to create the Question Set and add it to the live session materials.
9 When delivering an e-learning Question Set, allow for transmission time before tallying the responses.
C � 14 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
Using the Learning Conventions
This section includes the relevant information about the standard curriculum development conventions and icons. Use this section as a tool to prepare to deliver the course successfully.
What are conventions?
Conventions are rules that govern how to display specific types of information.
The following are standard curriculum development conventions and icons that may be used within this courseware.
Cautions are short, descriptive paragraphs meant to warn of potential pitfalls or areas where students could experience problems during class or back on the job.
Caution
Critical classroom setup procedures that the instructor must complete before presenting subsequent content.
Instructor Task
Note: Notes appear in the Instructor Guide and Student Guide and can be used to note differences in content.
Notes for the Instructor: Special notes the course developer wants to communicate to the instructor regarding delivery, classroom strategy, classroom tools, exceptions, and other special considerations.
Tip: Tips provide additional guidance, or a hint, for students about a topic or task.
Developing IBM Lotus Domino 6 Appl icat ions: Foundation Skil ls C � 15
PreviewAppendix C � Learning Processes and Instructor Guide Conventions
C � 16 Developing IBM Lotus Domino 6 Applications: Foundation Ski l ls
© Copyright IBM Corporation 2002. All rights reserved.
Lotus software
IBM Software Group One Rogers Street Cambridge, MA 02142
IBM Lotus Domino Designer
Release 6 Product Code ND510
Printed in the USA