What are they Good For?

Tamino server extensions extend – not surprisingly – the functionality of the Tamino server. Server extensions are defined on the level of individual databases. They can be implemented in a variety of languages, such as C++, Java, Natural and Visual Basic.

The areas of Tamino functionality that can be extended are:

Query functions

Server extension functions can be called in the context of a Tamino query and can thus extend the query language. Note that server extension functions can only extend X-Query and XQuery 4 expressions that are interpreted by the Tamino server, not XPath expressions that are used, for example, in an XSLT stylesheet processed in a pass-thru servlet.

Mapping functions

These functions are applied when documents are stored (onProcess), retrieved (onCompose) or deleted (onDelete). Typically, these functions are used to implement nodes of an XML document that are not stored natively in Tamino. These can be nodes that are derived from the values of other nodes, or nodes that are stored outside of Tamino, for example in a file system.

Triggers

Triggers are similar to mapping functions. The difference is that a mapping function consumes a subtree, whereas a trigger does not. Typically, triggers are used to execute actions when document nodes are inserted (onInsert), modified (onUpdate) or deleted (onDelete). The trigger action is executed in addition to the native Tamino operation.

Server event functions

These functions are executed at the end of a server request, commit or rollback and at the end of a session (connection end). Typically, they are used for housekeeping operations.

Shadow functions

These functions are used to create index values for non-XML documents as a shadow of the original.

Init functions

These functions allow initialization operations to be executed on the server extension object prior to any query, trigger or mapping function execution.

Server extensions that are written in Java can be implemented using the Tamino X-Tension Builder tool. Alternatively they can be implemented with third-party tools and then imported into Tamino with the help of the X-Tension Object Analyzer. Typically, several server extension functions are combined into a single server extension module such as a Java package.

In the following sections we discuss the development of Java server extensions with some examples. We implement two query functions that are of interest in connection with XML Schema datatypes, and we also implement a map-out function that is of interest in connection with the jazz example shown in From Conceptual Model to Schema::From Model to Schema. The section More examples shows how to extend X-Query with the help of query functions.