Lotus Notes Release 4.5: a Developer’S Handbook
Total Page:16
File Type:pdf, Size:1020Kb
redbook title AA0425 10/23/96 3:25 PM Page 1 Lotus Notes Release 4.5: A Developer’s Handbook International Technical Support Organization Edition Notice First Edition (November 1996) This edition applies to Release 4.5 of Lotus Notes. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. HZ8 Building 678 P.O. Box 12195 Research Triangle Park, NC 27709-2195 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © International Business Machines Corporation 1996. All rights reserved. Note to U.S. Government Users: Documentation related to restricted rights. Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Abstract This document describes how to develop applications with Lotus Notes Release 4.5. Lotus Notes is a distributed client/server platform that allows you to develop applications to be shared by groups of users across a network. The Integrated Development Environment (IDE) provided by Notes enables the development of strategic enterprise-wide business applications. Part 1 covers features such as databases, forms, subforms, views, action bars, layout regions, navigators, and agents. One chapter illustrates how to use LotusScript to write object-oriented sophisticated applications. Other chapters show you how to work with LotusScript Extensions, Lotus Components, and how to use the application development features of calendaring and scheduling. A workflow example is described in more detail. Examples and useful hints and tips are provided throughout. Part 2 is dedicated to tools and techniques that enable you to seamlessly integrate an existing IT infrastructure into your Notes applications. Several chapters take a close look at Domino, the integrated Notes/HTTP server, and the programmability features provided by this environment. Following this, we discuss the integration options that exploit the respective strengths of Notes and traditional database management systems and transaction systems. A case study illustrates the various features throughout part 2 of the book. The last chapter discusses the Notes C++ API. The book comes with a chart listing the LotusScript classes, methods, and properties based on Notes Release 4.5, and a diskette containing several sample applications. iii Contents Edition Notice ..................... ii Chapter 2 Creating Notes Databases ............ 17 Abstract .......................... iii Managing Your Workspace .................. 17 Preface .......................... xiii Managing Notes Databases ................ 17 Creating a Database .......................... 18 Part 1 Notes Application Using an Existing Template ............... 18 Development ...................... 1 Copying an Existing Database ............. 20 Chapter 1 Getting Started . ........ 3 Creating a New Database ................. 22 What Is Lotus Notes? ......................... 3 Changing the Database Properties . ........ 23 Notes Is an Environment for Basics on Database Building Blocks ........ 28 Application Development Deployment ............................ 3 Chapter 3 The Notes Notes ADE Is Mainstream, Modern, Integrated Development and Industrial ........................... 3 Environment ..................... 35 Notes Is Complete ......................... 5 Introduction ................................. 35 Integrated Notes HTTP Server .............. 7 Elements of the Forms Integrated Development Environment ............. 36 Integrated Messaging ...................... 7 Main Design Window ..................... 36 Native Calendaring & Scheduling . ......... 7 Wide Range of Effective Action Pane ............................... 36 Security Features ........................ 8 Design Pane .............................. 37 Effective Support of Mobile Users . ......... 8 Working With the Script Editor ............... 42 Access to External Data .................... 9 Design Pane Properties .................... 42 Notes Is a Document Database ............. 9 Searching Your Scripts .................... 45 The Messaging Infrastructure Exporting Script Programs ................ 46 Enables a New Class of Importing Script Programs ................ 48 Application ............................ 11 Special Script Editor Features .............. 49 Notes Has a Cross-Platform, Structured, BASIC-Compatible Chapter 4 Designing Programming Language ................ 12 Application Forms ............... 51 You Can Leverage a Range of Development Skills .................... 14 Using the Document Library Template ........ 51 Major Enhancements of Release 4.5 ........ 14 Creating Sample Documents .............. 52 Contents v Using Forms ................................. 54 Looking at the Properties Specifying Form Properties ................ 54 of Documents ......................... 105 Giving the Form a Title ................... 61 Using the Navigator ........................ 106 Looking at Form Events ................... 62 Navigator Objects ........................ 107 Creating a New Field ........................ 63 Adding an Action to a Navigator ........................... 107 Performing a Test Run .................... 64 A Navigator Example .................... 108 Sharing and Reusing a Field ............... 65 Creating a Navigator ..................... 109 Looking at Field Properties ................ 66 Adding an Action to a Creating Design Elements Navigator Object ...................... 113 for Subforms ........................... 72 Adding an Action Using Removing Subforms ...................... 74 LotusScript ........................... 114 Working With Layout Regions ............... 75 Testing a Navigator ...................... 115 Creating a Layout Region ................. 75 Including a Navigator in Working With Collapsible Sections . ........ 77 the View Menu ....................... 116 Creating a Collapsible Section ............. 78 Chapter 6 Programming Looking at a Collapsible Section . ........ 78 in Lotus Notes .................. 117 Looking at the Properties of a Templates .................................. 118 Standard Collapsible Section . ........ 79 Programming in Notes ...................... 121 Working With Tables ........................ 80 Simple Actions ........................... 121 Working With Buttons ....................... 81 Formulas ................................ 122 Creating a Button on the Action Bar ........ 81 LotusScript .............................. 122 Creating Hotspots ........................... 83 Using LotusScript Notes Classes ............. 124 Creating Links ............................ 83 Notes Classes ............................ 124 Defining Text Pop-ups .................... 84 Understanding Front-End and Creating Buttons in Forms ................. 84 Back-End Classes ..................... 124 Chapter 5 Viewing Class Hierarchy .......................... 128 the Database .................... 87 Using the Object Browser ................ 131 What Is a View? ............................. 87 Event Programming With LotusScript....... 132 Changing an Existing View ................ 87 Programmable Objects ................... 132 Creating Views ........................... 94 Events ................................... 134 Editing the View Columns ................ 96 Event Type and Sequence ................ 134 Creating and Moving Columns ........... 101 How Scripts and Formulas Are Executed ......................... 142 Using Folders ............................ 102 LotusScript Programming Tips Here Again the Action Bar ............... 103 and Considerations ................... 146 vi Lotus Notes Release 4.5: A Developer’s Handbook General Suggestions ..................... 146 Overview ................................ 173 Use Consistent Variable Names . ........ 147 What the LSX Toolkit Contains ........... 174 Using Script Libraries .................... 149 Considering the Toolkit Design ........... 176 Catching Errors at Compile Time . ........ 149 Understanding the C++ LSX Improving Form Performance ............ 149 Class Framework ..................... 180 When to Use Formulas LSX Design Decisions .................... 184 and LotusScript ....................... 150 Creating an LSX ............................ 186 Using the Evaluate Function Using LSX Data Types ................... 189 to Combine LotusScript Using Data Type and Formulas ......................... 152 Descriptions .......................... 191 Making Field Value Changes Accessing LSX Class Effective .............................. 154 Method Arguments ................... 192 Using Validation Formulas Accessing LSX Class and QuerySave ....................... 154 Property Arguments .................. 194 Working With a Rich Text Item ........... 155 Using LotusScript Prompting for User Input ................ 157 System Services ....................... 195 Guidelines for Presenting Testing an LSX .............................. 199 Dialog Boxes Using Formulas The LSXTEST Tool ....................... 199 Versus Scripts ......................... 159 The LSXRUN Tool ....................... 201 Error Handling ............................. 160 Deploying an LSX ........................... 201 Using On Error and Resume Statements ................... 160 The LSX Runtime Environment .......................... 201 Creating an Error Handler for Debugging ........................ 161 LSX Installation .........................