Document Sample
Programming_Languages_for_Domino_Designer_R5_LotusScript Powered By Docstoc
					Programming Languages for Domino Designer R5: LotusScript – 4 Days


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

        build a fundamental knowledge of LotusScript and how it is used to instantiate and execute
         Domino Object Model classes
        show appropriate use LotusScript to meet application goals
        provide extensive programming and debugging experience to ensure mastery of LotusScript
         techniques and Domino Object Model classes
        understand the relationship between LotusScript and Notes data types
        build a practical understanding of data validation and error trapping.


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 won't find this course
repetitive as it focuses mostly on the Domino Object Model.

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.

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
Course Road Map for R5 Developers and Courseware Costs:

                                  DDFL5 - 1
                                     day             Server
                                  $20 ebook         Agents
                                                   DDSA5 - 1
           Basic Apps
                                                   $20 ebook
           for Domino              LotusScript
            Designer               DDLS5 - 4
           DDBA5 - 4                  days
               days                $80 ebook
           $80 ebook

                                   DDJS5 - 2
Outline                            $40 ebook

Day 1

Topic 1: The Place of LotusScript in Domino

    Programming languages used 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

Topic 2: Object Events

    Event-driven language
    Event code
    Entering LotusScript code
    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 event code function name
Topic 3: Language Fundamentals

    Basic language rules
    Declaring variables
    Advantages of explicit declaration
    User-defined data types
    Statements versus functions
    Exercise: Experience LotusScript functions
    String functions
    Math functions
    Date functions
    Data conversion
    Boolean operators
    How Designer Help helps

Topic 4: Program Control Structures

    Program structure
    Experience control structures
    Branching structures
    Exercise: Branching structures
    MessageBox (Msgbox) parameters and return values
    Looping structures
    Looping performance
    Code benchmarking
    Exercise: Looping
    Accepting user input
    How to exit a structure
    Breaking out of an endless loop
    Exercise: Exit structure

Topic 5: Debugging

    Script errors
    Remarking code
    Finding errors
    Debugger buttons
    Debugger tabs
    Exercise: Using the Debugger
    Exercise: Break Points
    Debugging with MsgBox
    Public variables
    Exercise: Public variables

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

Topic 7: Domino Object Model

    What is an object?
    User-defined object classes
    Product-defined object classes
    Domino Object Model
    Back-end vs. Front-end classes
    Back-end object classes
    Front-end object classes
    How Designer Help helps
    Adding object classes

Day 2

Topic 8: Domino Object Instantiation

    Object instantiation
    Container objects
    Object reference variables
    Use generic object names
    Access current database using back-end methods
    Using Designer Help
    Exercise: Object Containers
    Access other databases using back-end methods
    Exercise: Object in another database
    Public declarations of Domino Objects
    When do you have to use "New"?
    Domino object properties
    Read object property
    Set object property
    Chaining references
    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

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
    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
    Case Study

Topic 11: New Document Operations

    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

Topic 12: Item 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 write
    Create a new item Option 3: Document object methods
    Create a new item Option 4: AppendItemValue method
    Reading item values Option 1: Extended class syntax
    Reading item values Option 2: NotesItem object Values property
    Reading item values Option 3: NotesDocument object methods
    Modifying existing item values
    Ensuring that an item exists
    Reading all items
    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: NotesItem Validation

    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

    Document selection
    Document collections
    NotesDocumentCollection collection
    GetNextDocument requirements
    Exercise: Loop through NotesDocumentCollection
    Solution: Loop through NotesDocumentCollection
    Adding or removing documents from a collection
    Document collection operations
    NotesView collection
    Exercise: Loop through NotesView
    Solution: Loop through NotesView
    NotesDocument object ColumnValues property
    Refreshing a view
    Primary key and view concerns
    Processing child documents
    Iterating all levels of a document hierarchy
    Sibling documents
    Accessing the parent document
    NotesViewEntryCollection collection
    NotesViewEntry and NotesDocument objects
    Exercise: Status Summary
    Solution: Status Summary
    NotesViewNavigator class
    Other collections
Topic 15: Search Methods

    NotesDocumentCollection by full text search
    The query
    Search fields
    Special search fields
    Search options
    Domain Search
    Using the results
    About the accuracy of full text search
    Refining an existing collection
    Exercise: FTSearch Method
    NotesDocumentCollection by search
    Search method performance
    Exercise: Search summary
    Solution: Search summary
    Switching search methods on-the-fly
    Build a collection by view key
    Example: Build a collection by view key
    Agent scope and search

Topic 16: Unprocessed Documents

    UnprocessedDocuments method to select documents for users
    Efficient processing by agents
    Unprocessed flag and agents
    Unprocessed search accuracy
    Exercise: Unprocessed Documents

Day 3

Topic 17: 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
    Exercise: Put documents in folder
    Remove document(s) from folder
    Remove folders
    Make response document
    Current document on the Web

Topic 18: Domino Data Validation
    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:
    DelayUpdates property

Topic 19: Arrays and Multi-Value Items

    Array basics
    How to declare an array
    Assign values to an array
    Read single array element value
    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
    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
    Exercise: Translate a multi-value field
    How does an "Item" differ from a "Field"?

Topic 20: Date-Time Items Operations

    How time is stored
    Date and Time in LotusScript
    NotesDateTime object
    Date/Time parameter format

Topic 21: Rich Text Item Operations

    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
    Abstracting rich text

Topic 22: Evaluate @Functions

    Which @Functions can NOT be used?
    Why use @Functions?
    Sum two fields
    String functions
    Uppercase field
    @Functions outside of object context
    Summing an array
    User Access
    Exercise: Using @Functions
    Performance implications

Topic 23: Mail Documents

    Send mail
    Example agent
    Send method parameters
    Recipient requirements
    Source database
    Exercise: Send message
    Optional properties and fields
    Exercise: Status Checker Agent
    Solution: Status Checker Agent

Day 4

Topic 24: Newsletters

    Newsletter objects
    Instantiating the NotesNewsletter object
    Exercise: Newsletter report
    Case Study: Custom Search form
    Sending "teasers"
    Searching the domain with FTDomainSearch
    Coding the FTDomainSearch method

Topic 25: User Interface Control

    Server + Database dialog box
    Exercise: PickListStrings
    Free Time dialogs
    Folder dialog
    Where you can call the DialogBox method
    Back-end to Front-end interaction
    Reloading document to show rich text
    Compute with form
    Status information
    Case study: Bring the data here

Topic 26: Event Control

    NotesUIDatabase and NotesUIView objects
    Continue value
    Stopping a form from closing
    Stopping users from deleting documents in folders
    Stopping users from pasting documents

Topic 27: Managing 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 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: 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 to user-defined procedures
    Where to define procedures
    Example: Sub procedure
    Example: Function
    Exercise: Value translation
    Script Library
    Call a procedure from the Script Library
    Exercise: Using a Script Library
    Process all child documents
    Find root parent document
    Resource strings
    Script Library pointers

Topic 30: 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

Topic 31: DLL Procedures

    Declare DLL procedure
    Call the DLL Procedure
    Read/Write INI file
    Get registry value
    Close any Notes window
    Run file from Notes

Topic 32: Component Object Model

    COM and OLE
    Object hierarchy
    Three ways to instantiate OLE objects
    Object identifiers
    Starting and stopping an application
    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: Create new Word object
Example 6: Work with embedded object

Shared By: