| Course Title: | Domino Designer 6: LotusScript |
| Course Code: | DDLS6 |
| Product: | Lotus Notes/Domino R6 |
| Provider: | wareSource |
| Duration: | 4 days |
| Topics/Pages: | 35 topics / 498 pages |
| Price (US dollars): | |
Description
During this course you will work with many of the Domino Object Model classes accessible to LotusScript™. The primary emphasis of the course is not on LotusScript itself, but rather on how to use basic LotusScript language elements to operate on the Domino object classes, including databases, Views, documents, Fields, and ACL settings.
This course is not a beginning programming class or a mere overview presentation of the LotusScript implementation in Domino and the Notes client. You will spend a good portion of the course coding in LotusScript and debugging code that will have immediate application beyond the term of the course.
Course goals
This course will help you:
- build a fundamental knowledge of LotusScript and how it is used to instantiate and execute Domino Object Model classes
- learn appropriate use of LotusScript to meet application goals
- master LotusScript techniques and exploit the Domino Object Model classes through extensive programming and debugging experience
- understand the relationship between LotusScript and Notes data types
- build a practical understanding of data validation and error trapping.
Audience
This course is designed for Domino Programmers. It assumes that you have:
- at least six months Domino application development experience
- thorough knowledge of the Domino Designer 6 development environment, including Form, View, and Agent design, as well as how to use properties boxes and set the ACL
- mastered the topics covered in Basic Applications for Domino Designer 6.
The course does not review any aspects of the non-LotusScript specific development environment.
Though not required, experience in any event-driven or structured programming language is helpful in understanding how to maximize the use of LotusScript. If you have used LotusScript in other Lotus applications or have built applications using Microsoft® Visual Basic™, you will find that this course won't be repetitive as it focuses mostly on Domino objects.
This course is part of a series of courses. Follow these paths to learn how to program using Domino Designer to create Notes and browser applications:
Courses later in the series assume that you have mastered the content of earlier courses.
Duration
This course is sold as a 4-day course, but it is unlikely that you can finish all the topics in four days. To finish in four days, it is recommended that you defer the last few topics for self-study. Most training centers allocate five days to cover this material.
Course design
The core of this course is hands-on coding experience using LotusScript. It only peripherally explores the principles of programming and does not attempt to cover every option of every object class.
All code fragments are labeled to make talking about them and reusing them in exercises easier. The intent in labeling them is also to help build a sense of modularity, purpose, and a way of "thinking" about LotusScript.
Topic 1: The Place of LotusScript in Domino
What is LotusScript?
Advantages of LotusScript
When to use LotusScript
Where the code runs
LotusScript respects security
What LotusScript can NOT do
Limits and performance
Other resources
Topic 2: Object Events
Event-driven language
Entering LotusScript code
Auto-completion
Programmers Pane properties
Print code
Syntax errors
Compile and test the code
Exercise: Create Button event script
What is the sequence of events?
Exercise: Experience the event model
What happened? Create document events
Query what? Post what?
Recalculate document event
Save document event
Close document event
Switch modes events
Read document events
Agent events
Database events
View events
Field events
Topic 3: Debugging
Script errors
Remarking code
Script Debugger
Finding errors
Debugger Buttons
Debugger tabs
Exercise: Using the Debugger
Exercise: Break points
Persistent breakpoints
Debugging with Msgbox and Print
Topic 4: Language Fundamentals
Basic language rules
MessageBox parameters and return values
InputBox
Variables
Declaring variables
Advantages of explicit declaration
Public variables
Exercise: Public variables
Constants
User-defined type
LotusScript functions
Exercise: Experience LotusScript functions
String functions
Math functions
Date functions
Data conversion
Boolean operators
How Designer Help helps
Topic 5: Program Control Structures
Program structure
Experience control structures
Branching structures
Exercise: Branching structures
Looping structures
Looping performance
Code benchmarking
Exercise: Looping
How to exit a structure
Breaking out of an endless loop
Exercise: Exit structure
Topic 6: Data Validation and Error Trapping
Check for empty variable
Failure to exit loop
Check data type
Other data type tests
Exercise: Data validation
Error handler
Resume after error
Goto after error
Specific error trapping
LSS files and error handling
Determining the Err code
Error cases
Exercise: Error trapping
Multiple error handlers
Topic 7: Domino Object Model
What is an object?
Object class properties and methods
Domino Object Model
Back-end vs. Front-end classes
Back-end object classes
Front-end object classes
How Designer Help helps
Topic 8: Domino Object Instantiation
Object instantiation steps
How to instantiate an object
Container objects
Object reference variables
Best practice: Use generic object names
Access current database using back-end methods
Best practice: Use constants
Using Designer Help
Exercise: Object containers
Access other databases using back-end methods
Exercise: Object in another database
Best practice: Public declarations of Domino objects
Domino object properties
Read object property
Set object property
Chaining references
Using "With"
Domino object methods
Running methods
Three types of methods
Exercise: Open method
LotusScript is not a keystroke macro language
Interacting with users via front-end methods
Exercise: Open database for user
Delete an object reference
Topic 9: NotesSession Operations
Session properties
NotesName object class
NOTES.INI access
Data type assignment from environment
Exercise: Set environment
Topic 10: NotesDatabase Operations
Paths to instantiate NotesDatabase
Select and open database
Ways to create a new NotesDatabase object
Access to "local" databases
Is the database really open?
Exercise: Database Info
NotesReplication class
Exercise: NotesReplication class
Open database for user in UI
Open a database by property
Error trapping for opening databases
Exercise: Find database
Create non-replica database copy
Who can create a database?
Copying documents to new database
Exercise: Database Copy
Error handler review
Create replica copy
New database from template
ACL of new database from using template
Delete database
Case Study
Topic 11: New Document Operations
New document (back-end)
Document properties
New document using Form (front-end)
Exercise: Create NotesUIDocument object
Topic 12: NotesItem Operations
Create a new item Option 1: Extended class syntax
Data type of a new item
Create a new item Option 2: NotesItem object New method
Item properties you can set
Create a new item Option 3: Document object method
Create a new item Option 4: AppendItemValue method
Read item values Option 1: Extended class syntax
Read item values Option 2: NotesItem object Values property
Read item values Option 3: Use GetItemValue method
Modify existing item values
Best practice: Ensure the item exists before using it
Read all items
Remove item
Exercise: Manipulate NotesItem objects
Challenge Exercise I: System Inventory
Objects required for Challenge Exercise
Pseudocode for Challenge Exercise
Topic 13: UI Object Classes
NotesUIWorkspace object
Close method
NotesUIDocument object
Instantiating the current document
Front-end UI methods
Back-end to front-end interaction
NotesUIDocument limitations
Reloading document to show Rich Text
Using the "Source" object reference variable
Instantiating container object
Exercise: Flip-Flop via back-end methods
Exercise: Flip-Flop via front-end methods
NotesUIView object
Refreshing a View
Topic 14: Notes Data Validation
Form translation and validation
Check empty object
Example: Check empty object
Check for empty item (Field)
Example: Check for empty item (Field)
Accessing fields in a Form
Field focus
Simple Field validation
Exercise: Item validation
Compute with Form
Continue value
Example: Stop a Form from closing
Stopping users from deleting documents in folders
Stopping users from pasting documents
Topic 15: Multi-Value Items and Arrays
Array basics
How to declare an array
Assign values to an array
Split
Join/Implode
Read single array element value
Iteratively read array elements
Find an array element
Replace values in an array
Replace
Determine the number of elements in an array
Remove blank elements
ArrayUnique
Sort array
Create a dynamic array
Resize a dynamic array
Create copy of an array
Erase array values
Exercise: Dynamic array
Append one array to another array
Multi- dimension arrays
Items and multi-value Fields
Variable assignment
Testing equivalence
Reading an array of strings or array of objects?
Get multi-value Field in current document
Set multi-value Field in current document
Append to existing multi-value Field
Exercise: Translate a multi-value Field
How does an "item" differ from a "Field"?
Challenge Exercise II: System inventory
Arrays and performance
Lists
Topic 16: Date-Time Items Operations
How time is stored
Date and time in LotusScript
NotesDateTime object
Date/Time parameter format
NotesInternational object
Topic 17: Rich Text Item Operations
Rich Text programmatic issues
Instantiate NotesRichTextItem object
Accessing existing NotesRichTextItem objects
Objects you can add to Rich Text item
Append text
Append spacing
Append style
Best practice: Style arrays and subs
Append doclink
Exercise: Formatted Rich Text
Append attachment
Append another NotesRichTextItem
Abstract text
Challenge Exercise III: System inventory
Navigate through the elements in a Rich Text item
Insert object into existing Rich Text
Example: Append and populate table
Topic 18: Document Collections
Document selection
NotesDocumentCollection object
GetNextDocument requirements
Exercise: Loop through NotesDocumentCollection
Solution: Loop through NotesDocumentCollection
Adding or removing documents from a collection
Document collection operations
Other collections
Sort a collection
Topic 19: NotesView "Collections"
NotesView object
Exercise: Loop through NotesView
Solution: Loop through NotesView
NotesDocument object ColumnValues property
Primary key and View concerns
Build a collection by View key
Example: Build a collection by View key
Processing descendent documents
Iterate all levels of a document hierarchy
Sibling documents
Accessing the parent document
View.EntryCount property
NotesViewEntryCollection object
NotesViewEntry and NotesDocument objects
Exercise: Status summary
Solution: Status summary
NotesViewNavigator object
Topic 20: Search Methods
NotesDocumentCollection by Full Text Search
The query
Search items using [FIELD]
Search on special items
Search options
Using the results
About the accuracy of Full Text Search
Refining an existing collection
Exercise: FTSearch Summary
Solution: FTSearch summary
NotesDocumentCollection by search
Changing a View Selection Formula
Search method performance
Exercise: Search summary
Solution: Search summary
Switching search methods on-the-fly
Domain Search
Coding the FTDomainSearch method
Topic 21: Unprocessed Documents
Unprocessed documents and user interaction
Efficient processing by Agents
Unprocessed flag and Agents
Unprocessed search accuracy
Exercise: Unprocessed documents
Topic 22: Existing Document Operations
Make a copy of the current document
Delete document
Exercise: Archive selected documents
Delete current document
IsValid document? IsDeleted document?
IsDeleted and soft deletes
Delete documents while looping through a collection
Open user-selected document
Put document in Folder
Put document in Folder (the easy way)
Exercise: Put documents in Folder
Remove document(s) from Folder
Remove Folders
Make Response document
Topic 23: Newsletters
NotesNewsletter object
Create newsletter
Exercise: Newsletter report
Case study: Custom search Form
Optional exercise: Order report
Sending "teasers"
Topic 24: Mail Documents
Send mail
Example Agent
Send method parameters
Source database
Change the apparent sender name from Notes
Change the apparent sender name from an Agent
Prevent Agent mail "ping-pong"
Exercise: Send message
Optional properties and Fields
Exercise: Status Checker Agent
Solution: Status Checker Agent
Challenge Exercise IV: System inventory
Topic 25: Evaluate @Functions
Which @Functions can NOT be used?
Why use @Functions?
Syntax
Sum two Fields
String functions
Uppercase Field
@Functions outside of object context
Summing an array
Lookups
Exercise: Using @Functions
Performance implications
Topic 26: Dialog Boxes
OpenFileDialog
SaveFileDialog
Prompt
Choose Database dialog box
PickListCollection
PickListStrings
Exercise: PickListStrings
Free Time dialogs
Folder dialog
DialogBox
Where you can call the DialogBox method
Status information
Case study: Bring the data here
Topic 27: Database Access
Why control the ACL with LotusScript?
Minimum access requirements
Find a known ACL entry level
Current user access
ACL level constants
Iterate ACL entries
Add an ACL entry
When to save ACL changes
-Default- special handling
Exercise: Set ACL
Change the level of an entry
Rename an entry
Delete an entry
Exercise: ACL control
Set permissions
Set entry type
Add a Role
Associate an entry with a Role
Role resolution
Disassociate entry from Role
Rename Role
Remove a Role
ACL and replication
Topic 28: Profile Documents
What Profile documents are used for
The nature of Profile documents
Create Profile document
Back-end method to access Profile document
Read profile Fields
List Profile documents
Delete Profile document
Topic 29: Procedures and Script Libraries
Advantages of using procedures
How/where to define procedures
Function procedures
Call a function
Single function argument
Pass an array as an argument
Multiple function arguments
Example: function
Exercise: Value translation
Exit a procedure
Sub procedures
Example: Sub procedure
Pass argument by reference
Pass argument by value
Script Libraries
Use "LibraryName" statement
Exercise: Using a Script Library
Resource strings
Script Library tips
Example: Process all child documents in response hierarchy
Example: Find root parent document
Recompile all LotusScript
%Include LSS files
Topic 30: Custom Classes
Developer-defined custom classes
Derived classes (inheritance)
Memory management
Resources: Get more classes
Example: Custom class
.LSO files
.LSX files
Calling Java classes from LotusScript
Topic 31: Agents
Create new Agent
Trigger
Target
Document selection "event"
Unprocessed documents
Before New Mail Arrives trigger
Agent security
Error trapping UI methods in Agents
DelayUpdates property for Agents
Domino Server Log
Agent log
Agent log actions
Custom logging
Creating a custom log database
Custom log code
Usage guidelines
Topic 32: Web Agents
Web Agent properties
WebQueryOpen event
WebQuerySave event
Referencing the current document
To save or not to save?
Print statements
?OpenAgent URL command
Three ways to pass data to a Web Agent
Parse URL arguments
Debugging Web Agents
Browser response codes
Common response codes
Browser display
Web Agent errors
Resources
Topic 33: File I/O Operations
Opening a file for operation
Reading lines from a file
Read performance
Delete a file
Create a file
Exercise: Append to text file
Export records to text file
Easy comma delimited export
Import records from text file
NotesStream class
Alternate character sets
Platform considerations
Topic 34: Calling DLL Procedures
Declare DLL procedure
Call the DLL Procedure
GetFolderName
Read/Write INI file
Get registry value
Close any Notes window
Run file from Notes
Win32 Internet function library
Topic 35: COM/OLE Automation
COM and OLE
Automation controller
Object identifiers
Starting and stopping an application
Object hierarchy
Access the object methods and properties
Example 1: Create object in PostOpen event
Example 2: Create Excel object from file
Example 3: Create new Excel object and set formula
Example 4: Create new Excel chart object
Example 5: Export View to Excel
Example 6: Create new Word object
Example 7: Create new Word object (labels)
Example 8: Windows Script Host
Compound Document Container
Example 9: Work with embedded object
COM access to Domino objects
Troubleshooting OLE