Tivoli Service Desk 6.0 Developer's Toolkit
Script Programming Guide
Table of Contents
Copyright
Preface
Description
Who Should Read this Book
What this book contains
Other Books in This Library
Typeface Conventions
Special Elements
Product Name Acronyms
Platform-specific Information
Contacting Customer Support
Introduction
Chapter 1: Developer's Toolkit Overview
New Features in Developer's Toolkit
What is Developer's Toolkit?
List of new features
Introduction to TSD Script
What is TSD Script?
Knowledgebases
Information forms
Data types
Knowledgebase Conventions
Identifiers
Use of quotes
Comments
Required naming conventions
Optional naming conventions
Major Sections
Public sections
Private sections
Minor Sections
Optional sections
Knowledgebase Example
Identifier examples
Constant, variable, and procedure examples
USES example
Chapter 2: Data Types
Introduction
Simple Data Types
Developer's Toolkit data types
Other Data Types
Handle types
External parameter types
Aggregate types
Constants
Declaring a constant
Variables
Declaring a variable
Assigning values to variables
Data Type Conversions
Simple data type conversion
Calculating with a data type conversion
Assignment errors
Automatic type conversions
String Expressions with Simple Data Types
String expression functions
Operators and statements
Integer and Real Expressions
Arithmetic expressions and operators
Additional operators
Boolean Expressions
Logical operators
Relational operators
Case-sensitive operators
Date Expressions
Changing date variables
Calculating date differences
Time Expressions
Changing time variables
Calculating time differences
Arrays
Accessing arrays
Strings as arrays
Resizing arrays
Lists
List advantages
Using lists
List pointers
Other list functions
FOR loops
Special list constants
List chunking
Records
Declaring a record variable
Variable code example
Referencing variable fields
Assigning compatible variables
Input and output statements
User-defined data types
Assignment compatibility
Initializing variables
Variable conventions
The value $Unknown
Chapter 3: Conditional and Control Structures
Introduction
Conditional constructs
Control constructs
The IF statement
IF statement form
IF example
True conditions
False conditions
Short-circuited Boolean evaluation
The WHEN Statement
IF statement example
WHEN statement example
FOR Loops
FOR example
Using DOWNTO
Using FOR in lists
REPEAT Loops
Boolean expressions
WHILE Loops
Exit and the ExitLoop Statement
Exit
ExitLoop
ExitLoop example
Chapter 4: Knowledgebase Components
Introduction
The ROUTINES section
Locating ROUTINES in the public section
Using ROUTINES in the private section
The USES section
Introducing the USES section
Using multiple knowledgebases
Using a knowledgebase privately
Using a knowledgebase publicly
Cyclical use of public knowledgebases
Procedures
Using local variables with nested variables
Creating local routines
Scoping
Scoping example
Scoping example explanation
Parameter Passing
Passing information to a procedure
Passing by REF or VAL
Treating parameters as variables
Functions
Function form
Using $Result
Using Exit with functions
Calling Library Procedures and Functions
Developer's Toolkit's declaration syntax
External routine syntax
Entry points
Constructing a function name
Linkage specifications
Mapping external DLL types
Parameter Passing for External Routines
VAL parameters
REF parameters
Translating data
Data structures and binary packing
Data annotation format
Default value annotation
Packing annotations
FILL annotations
Chapter 5: Event-Driven Programming
Introduction
Definition
Object-oriented influences
Event Handlers
Defining event handlers
Event handler features
$Handle
Implicit Parameters
Receiving event parameters
Event-specific information
Instance Data
Event handlers and instance data
Maintaining current items
Chapter 6: Using the TSD Script Window System
Introduction
Window description
Using WinCreate
Creating a generic window
Example WinCreate arguments
Using creation flags
Creating a window
Drop-Down Menus
Creating a drop-down menu system
Menu options
Event parameters and menu commands
Generic Windows
Cursor position in a generic window
Window statements
Window creation statements
Repainting generic windows
Virtual Scroll Windows
Creating a virtual scroll window
Virtual scroll window example
Virtual scroll window statements
Cursor position
Chapter 7: The Form System
Introduction
Definition
Form controls
Form files
Sample form code
DlgBox statement arguments
DlgBox example
Form Event Handlers
Event handler example
The $MsgSelect Event
Generating a $MsgSelect event
Other Form Events
Form Control Names
Additional control attributes
Table
Description
Table example
Example explanation
Creating Forms
Modal forms
Modeless forms
Tabbed forms
Chapter 8: Database Management Facilities
Introduction
SQL overview
Supported databases
SQL Support in Developer's Toolkit
SQL statements not supported with direct drivers
Data Source Attributes and Descriptions
Database source definition
Source attributes
CASE_CONVERSION
CASE_SENSITIVE
COLUMN_DEFINITION_TABLE
COMMIT_SELECTS
DATE_FORMAT
Specifying the day
Specifying the month
Specifying the year
Separators
DBMS
DEFAULT
DRV
DSN
MANUAL_COMMITS
MULTIPLE_CONNECT
MULTIPLE_CONNECT_REQUIRED
QUAL
SYSQUAL
TABLE_DEFINITION_TABLE
TIME_FORMAT
Military time
Case-Insensitive time formats
Trimming leading zeros
Specifying seconds
Separators
UPPERCASE_FUNCTION
Connecting Your Application to a Database
SQL configuration file name
Other locations for configuration instructions
Database configuration example
Testing the database client connection
Connection information in the SQL configuration file
Eliminating the SQL configuration file
An Example Database
Database tables and views
Retrieving Data with SQLSelectInto
SQLSelectInto
First argument
Subsequent arguments
Using a Record Variable
Record types
Using TSD Script Import Statements
Import statements
Connection string
Parsing with the /S option
Using keywords
IMPORT statement examples
Incorrect example
Data types
Multiple Row Retrieval
Process
Example
Qualifiers
Using qualifiers
Qualification substitution
Quotes
Concatenating strings with quotes
Exceptions
Data Formatting with the SQLFormat Statement
Using SQLFormat
Example
Name Overrides
Retrieving data without matching names
Updating Data
Introduction
Inserting data
Deleting data
Modifying data
Passive concurrency
Transaction-Oriented Processing
Description
Example
Unknown Values in SQL Columns
Using null values
Mapping unknown values
Error Handling
Detecting error messages
Filtering error messages
Using Commands for Multiple Executions
Preparing SQL looping commands
Substituting parameter markers
Nested SQL statements
Chapter 9: The Tivoli Service Desk (TSD) Script Mail Interface
Introduction
Store and forward mechanism
Communications APIs
The VIM protocol
MAPI
SMTP
POP3
Using TSD Script Mail with Protocols
Uses of the TSD Script Mail interface
TSD Script Mail Interface Terms
Address books
Entity
File attachments
Inbox
Mail administrator
Mailbox
Message
Message client
Message container
Message header
Message items
Message type
Note parts
Server
User address
User ID
TSD Script Mail Record Structures
Header File
Specifying message items
Message header
Message attributes
Message summary
Filtering records
MAILInfoRec
Address books
Implementing the TSD Script Mail Interface
Adding the TSD Script Mail interface to a TSD Script program
Initializing the TSD Script Mail interface
Opening a session
Initializing the message header
Initializing the list of recipients
Specifying a recipient
Specifying a recipient by name
Specifying a recipient by address
Specifying the list of message items
Writing the SendMailMessage procedure
Reading messages in the message container
Closing a TSD Script Mail session
Terminating the TSD Script Mail interface
TSD Script Mail Return Codes
Error codes generated in the VIM layer
Error codes generated by the MAPI layer
Error codes generated by SMTP
Error codes generated by TSD Script
TSD Script Mail constants
Mail.kb File
TSD Script Mail file
Chapter 10: Programming for International Uses
Introduction
Internationalization resources
Operating System API support
Unicode support
Cultural Considerations
Cultural categories
Code pages
Keyboard layouts
Sorting and comparing strings
String concatenation
Input method editors
Numerical formats
Page/envelope sizes
Units of measurement
Text expansion
Icons, bitmaps, and colors
Locale Support
International locales supported
Enhancements for Internationalization
Extended character printing
Using international characters in configuration files
Year 2000 processing
Chapter 11: Networking Concepts
Introduction
What you need to know
Networking architectures
Networking Terminology
Bi-directional communication
Client
Connection
Event handler
Handle
TSD Script server
Local event handler
NETx statements
Peer-to-peer environment
Registering
Reverse connection
Server
Service
Event Handlers
Defining event handlers
NetRegister and NetListen Event Handlers
Registering an event handler and its service
Using ports with a network connection
Creating a wildcard service
Templates
Changing an event handler and its template
Stopping an event handler from processing requests
Getting host (server) and service information
Establishing local communication between event handlers
Connections
Opening a connection
Closing a connection
Client-initiated closure
Server-initiated closure
Instance Data
Event handler references to instance data
Initializing the instance data
$Unknown instance data
Multiple connections for an event handler
Blocking and Non-blocking Statements
Blocking statements
Non-blocking statements
Choosing the type of statement to send
Handles
Opening a handle
Closing a handle
Establishing Bi-Directional Communication
Client/server
Peer-to-peer
TSD Script handles for peer-to-peer connections
Advanced Statements: NetListen and NetAccept
Table of event handler differences
Uses for
NetListen
and
NetRegister
event handlers
NetListen
connections
Handle
Assigning specific instance data for a
NetListen
connection
Example TSD Script Talk Program
Chapter 12: Networking Messages and Event Handlers
Introduction
TSD Script Messages for Networking
TSD Script messages used with NETx
Glossary
Tivoli Service Desk 6.0 Developer's Toolkit Script Programming Guide
Copyright