smex, short for Simple Messaging EXtension, is a
SALT element that communicates with the external component of the SALT platform.
It can be used to implement any application control of platform functionality
such as logging and telephony control. As such, smex represents a useful mechanism
for extensibility in SALT, since it allows any new functionality to be added
through this messaging layer.
On its instantiation, the object is directed to establish an asynchronous message
exchange channel with a platform component through its configuration parameters
(specified in param elements) or attributes. The smex
object can send or receive messages through this channel. The content of a message
to be sent is defined in the sent property. Whenever the value
of this property is updated (either on page load or by dynamic assignment through
script or binding), the message is sent to the platform. The smex
element can also receive XML messages from the platform component in its received
property. The onReceive event is fired whenever
a platform message is received. Since the smex object's
basic operations are asynchronous, it also maintains a built-in timer for the
manipulation of timeout settings. onTimeout
and onError events may also be thrown.
The smex object makes no requirement on the means
of communication with platform components. It should also be noted that the
smex object has the same life span as other XML elements,
that is, it will be destroyed when its hosting document is unloaded. While in
many cases, the smex object can perform automatic clean-up and release communication
resources when it is unloaded, there might be use cases (e.g. call control)
in which a persistent communication link is desirable across pages. For those
cases, SALT places the responsibility of relinquishing the allocated resources
(e.g. closing the socket) on the application.
The smex object also is neutral on the format (schema)
of messages. In order to encourage interoperability, however, the conformance
criteria in Part 4 recommend that implementations support a known schema for
common functionality, with a strong preference for existing standard message
formats. Such a schema for telephony call control is suggested in section 2.4.4,
and 4.3 of the SALT 1.0 Specs. In essence, SALT allows both platform and application
developers to take the full advantage of the standardized extensibility of XML
to introduce innovative and perhaps proprietary features without necessarily
losing interoperability.
| Name | Data type | Default |
|---|---|---|
ID |
implied |
|
script.statement |
implied |
|
script.statement |
implied |
|
script.statement |
implied |
|
CDATA |
implied |
|
milliseconds |
implied |
none
|
<html xmlns:salt="http://www.saltforum.org/2002/SALT"> |
<!-- logging mechanism that uses a COM object with its class id
and interface id --> <salt:smex id="logServer"> |
For details on usage of this element, see the SALT Specification, Version 1.0.