Figure 32. OpenDoc Open Scripting ArchitectureOne of the major goals of OpenDoc is to increase the level of customization that you can do with documents or applications. Experienced users or system integrators want to do much more with components than just assemble them. Many tasks can be automated. OSA provides the automation technique done by scripts. OSA defines also how components can collaborate and communicate using events. OSA enables collaboration between components beyond the very basic mechanisms of layout and resource negotiations OpenDoc is dealing with, as described in "Frames and Facets" in topic 2.3.2.1. These OSA events can be launched either directly or by scripts. Scripts can be attached to parts, and a user-interface control such as a button might consist of nothing more than a part that executes a script when activated.
Scripts are programs executed by interpreters. Scripting forms a rich medium for coordinating the work of parts in documents, and allows you and parts to work together to perform tasks.
Today script programs are the base for an agent technology. They can be small pieces of code that can perfrom specific tasks such as buying or selling shares. They may be coded so that they control whether a stock is bought or sold depending on its price. They could also be coded to collect infromation from different internet sites. The scripting language provided with OS/2 is REXX. Because OS/2 TCP/IP is providing a socket API and an OS/2 FTP API for REXX, it is possible to run REXX programs also on the Internet.
REXX, with its extension to Object REXX as delivered with the The Developer Connection for OS/2 Volume 9 Special Edition, can also be used as a scripting language for OSA, to enable collaboration between parts or to customize OSA-aware applications.
The implementation of this collaboration between parts in an OS/2 environment is called the interapplication communication (IAC). The IAC architecture comprises the following parts, as shown in the next figure Figure 33:
1. Open scripting architecture (OSA) provides a mechanism that allows users to control multiple applications by means of scripts, or sets of instructions, written in a variety of scripting languages. Each scripting language has a corresponding scripting component that is managed by the Component Manager. When a user executes a script, the scripting component sends OSA events to one or more applications to perform the actions the script describes.
2. OSA Event Manager allows applications to send and respond to OSA events.
3. Presentation Manager allows applications to send and respond to high-level events other than OSA events.
Figure 33. Interapplication CommunicationOSA is based on events. OSA extends the existing messaging mechanism provided by Presentation Manager in OS/2 by semantic messages. That means the objects addressed by a message can be described in a semantic way. For example in Figure 34 in topic 2.6.2. The script command:
copy table "Summary of Sales" to Totals
describes the object's table and totals in a very general semantic way. For further explanation see also " Standard Events" in topic 2.6.2. OSA provides a set of common event suites the components collaborating can agree on. The scripting component provides human-language equivalents to OSA event codes. OSA allows users to record their actions in the form of a script when using a scripting component that supports recording. The recording is not supported in the current release by REXX. OSA allows provides the infrastructure to manipulate and execute scripts via a script editor. These OSA events can be generated by scripting components as REXX or sent directly by applications. The most important requirement for high-level communication among all applications is a common vocabulary of events. High-level events that conform to this protocol are called OSA events.
Subtopics: