Intercalate Logo
Intercalate is an abstraction, a distillation, an expression.
Intercalate reveals themes in diversity, melodies in symphony, reflections of unity.

Example 3 Intercalate as an embedded application

The last few examples have shown how the Intercalate tools merge property list and template files to produce realizations. Intercalate also supports an application programming interface which can be invoked from any Java application or applet.

The applet below illustrates this interface. (The Java archive is large, almost 225 kb, so please be patient while it downloads.) The checkboxes allow the user to selectively enable or disable certain attributes in the property list. The template extracts data from this property list and presents it as a story. Each time the selection changes, Intercalate is invoked to apply the template to the modified property list and display the corresponding realization.

Your browser does not support Java, so nothing is displayed.

If you press the Show property list and template button, a separate window will open displaying textual representations of the property list and template. These representations are fully editable. Try adding an entry for another bear to the property list. Observe the effects on the realization when you press the Intercalate button. In the template, see what happens when you change the order of the for loops over the lists of bears and objects.

This applet uses a preconstructed property list and template, but you shouldn't infer from that any limitation in the Intercalate API. A more sophisticated application might, for example, generate the property list dynamically from records in a database, and format them for presentation using an HTML template customized at run time to the user's preferences.

If you're interested, look over the source code for this example of Intercalate used in an embedded application.
 
Alodar Systems