|
| Description |
| During this course you will thoroughly explore most 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. Expect a challenging and rewarding experience entering and debugging code that will have immediate application beyond the term of the course. |
|
| Course Goals |
This course will:
|
|
| Intended 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 5 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
.
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 focuses more on the Notes objects and little on BASIC programming. |
|
| Course Overview |
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.
The course takes a task-oriented approach, during which you will create programs that are extremely portable across applications and easy to move from buttons to fields to agents.
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.
Day 1
Topic 1: The Place of LotusScript in Domino
Key points
Programming languages used in Domino
Cross-platform and cross-product
Advantages of LotusScript
When to use LotusScript
Where the code runs
LotusScript respects security
What LotusScript can NOT do
Topic 2: Object Events
Key points
Event-driven language
Exercise: Create button event script
What is the sequence of events?
Query what? Post what?
Exercise: Experience the Event Model
What happened? Create document events
Recalculate document event
Save document event
Close document event
Switch modes events
Read document events
Agent events
Database events
View events
Field events
Changing a script reference
Topic 3: Language Fundamentals
Key points
Basic language rules
Variables
Declaring variables
Advantages of explicit declaration
Constants
Statements versus functions
Exercise: Experience LotusScript functions
String functions
Math functions
Date functions
Data conversion
Boolean operators
Topic 4: Program Control Structures
Key points
Program control
Experience control structures
Branching structures
Exercise: Branching structures
MessageBox (Msgbox) parameters and return values
InStr function
Looping structures
Looping performance
Exercise: Looping
Accepting user input
How to exit a structure
Breaking out of an endless loop
Exercise: Exit structure
Topic 5: Debugging
Key points
Script errors
Remarking code
Debugger
Finding errors
Debugger buttons
Debugger tabs
Exercise: Using the Debugger
Public variables
Exercise: Public variables
Variable scope
Exercise: Break Points
Topic 6: Data Validation and Error Trapping
Key points
Check for empty variable
Failure to exit loop
Check data type
Other data type tests
Exercise: Data validation
Error Handler
For more help
Resume after error
Goto after error
Specific error trapping
LSS files and error handling
Determining the Err code
Exercise: Error trapping
Multiple error handlers
Other debugging techniques
Topic 7: Domino Object Model
Key points
Domino Object Model
Back-end vs. Front-end classes
Back-end object classes
ACL object classes
Front-end object classes
Agent object class
Log object class
Class to access external data
Topic 8: Object Instantiation
Key points
Object instantiation
Container objects
Object reference variables
Access other databases
Use generic object names
Access current database
Object properties and methods
Role of LotusScript with objects
Properties
Read object property
When do you have to use "New"?
Access to local databases
Chaining references
Exercise: Object Containers
Array of columns
Set object property
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
Topic 9: Session Operations
Key points
Session properties
NotesName object class
NOTES.INI access
Data type assignment from environment
Exercise: Set environment
Topic 10: Database Operations
Key points
Select and open database
Ways to create a new NotesDatabase object
Exercise: Database Info
NotesReplication class
Open database for user
Open a database by property
Three types of error trapping
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
Day 2
Topic 11: New Document Operations
Key points
New document (back-end)
Create and save a new document via back-end
New document using form (front-end)
Document properties
Exercise: Scripted action buttons
Current document on the Web
Topic 12: Item Operations
Key points
Create a new item Option 1: Extended class syntax
Data type of a new item
Create a new item Option 2: NotesItem object New d
Item properties you can write
Create a new item Option 3: Document object meth
Create a new item Option 4: AppendItemValue meth
Reading item values Option 1: Extended class synt
Reading item values Option 2: NotesItem object Vaproperty
Reading item values Option 3: NotesDocument objechods
Modifying existing item values
Ensuring that an item exists
Removing items
Using front-end UI methods in current document
Using the "Source" object reference variable
Exercise: Flip-Flop via Front-End methods
NotesUIDocument limitations
Using back-end methods on the current document
Exercise: Flip-Flop via Back-End methods
Topic 13: Item Validation
Key points
Check empty object
Example: Check empty object
Check for empty item (field)
Accessing fields in a form
Simple field validation
Field focus
Exercise: Item validation
Topic 14: Document Collections
Key points
Document selection
Document pools
NotesDocumentCollection pool
GetNextDocument requirements
Exercise: Loop collection
Solution: Loop collection
Adding or removing documents from a collection
NotesView pool
Primary key and view concerns
Document collection operations
Processing child documents
Iterating all levels of a document hiearchy
Sibling documents
Accessing the parent document
NotesViewEntryCollection pool
NotesView and NotesDocument objects
Exercise: Status Summary
Solution: Status Summary
NotesViewNavigator class
Topic 15: Search Methods
Key points
NotesDocumentCollection by full text search
About the accuracy of full text search
Exercise: FTSearch Method
NotesDocumentCollection by search
Exercise: Search summary
Solution: Search summary
Switching search methods on-the-fly
Accessing the view by key
Topic 16: Unprocessed Documents
Key points
Efficient processing by agents
Unprocessed flag and agents
Exercise: Unprocessed Documents
Unprocessed search accuracy
UnprocessedDocuments method to select documents fers
Topic 17: Existing Document Operations
Key points
Make a copy of the current document
IsValid document? IsDeleted document?
IsDeleted and soft deletes
Delete current document
Exercise: Archive selected documents
Alternate way to remove documents
Open user-selected document
Put document in folder
Exercise: Put documents in folder
Remove document(s) from folder
Remove folders
Make response document
Topic 18: Data Validation
Key points
Form translation and validation
Read and write items in another document
Batch document processing
Exercise: Batch document renumbering
Batch document processing with intelligence
Exercise: Batch processing with intelligence
Exercise solution:
Topic 19: Arrays and Multi-Value Items
Key points
Array basics
How to declare an array
Assign values to an array
Read array element values
Iteratively read array elements
Find an array element
Replace values in an array
Determine the number of elements in an array
Remove blank elements
Create a dynamic array
Resize a dynamic array
Erase array values
Exercise: Dynamic array
Challenge Exercise
Solution: Challenge
Append one array to another array
Multi- dimension arrays
Items and Multi-Value Fields
Arrays and multi-value fields
Type mismatches
Reading an array of strings or array of objects?
Set multi-value field in current document
Append to existing multi-value field
How does an "Item" differ from a "Field"?
Topic 20: Date-Time Items and Computation
Key points
How time is stored
Date and Time in LotusScript
NotesDateTime object
Date/Time parameter format
Day 3
Topic 21: Rich Text Item Operations
Key points
Rich text primer
Create rich text item
Accessing existing rich text items
Things you can append to rich text item
Append text
Append spacing
Append style
Append DocLink
Exercise: Order Report
Attachments
Abstracting rich text
Topic 22: Using @Functions
Key points
Why use @functions?
Syntax
Sum two fields
String functions
Uppercase field
@Functions outside of object context
Summing an array
Lookups
Exercise: Using @functions
Topic 23: Mail Documents
Key points
Send mail
Example agent
Send method parameters
Exercise: Message
Optional properties and fields
Exercise: Status Checker Agent
Solution: Status Checker Agent
Topic 24: Newsletters
Key points
Newsletter objects
Instantiating the NotesNewsletter object
Exercise: Newsletter report
Sending "teasers"
Searching the domain with FTDomainSearch
Coding the FTDomainSearch method
Topic 25: User Interface Control
Key points
OpenFileDialog
Opening a NotesDatabase
SaveFileDialog
Prompt
PicklistCollection
PicklistStrings
Exercise: PickListStrings
Free Time dialogs
Folder dialog
DialogBox
Document refresh
Compute with form
Status bars
Topic 26: Event Control
Key points
NotesUIDatabase and NotesUIView objects
Continue value
Stopping a form from closing
Stopping users from deleting documents in folders
Exercise: Undelete view
Topic 27: Managing Database Access
Key points
Minimum access requirements
Find a known ACL entry level
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 entry flags
Set entry type
Add a role
Associate a user with a role
Disassociate user from role
Rename role
Remove a role
ACL and replication
Topic 28: File Operations
Key points
Opening a file for operation
Reading lines from a file
Delete a file
Create a file
Exercise: Append to text file
Export records to text file
Easy CSV export
Import records from text file
Windows API calls
Topic 29: Procedures and Script Libraries
Key points
Advantages to user-defined procedures
Where to define procedures
Example: Sub procedure
Example: Function
Exercise: Value translation
Create a Script Library
Call a procedure from the Script Library
Exercise: Using a Script Library
Process all child documents
Find root parent document |