ToXgene has a highly modular architecture; applications access the data
genertion engine trhough an API that consists of three main
modules (described below).
The API was implemented to allow all of ToXgene's functionality to be
accessible to any Java application in a modular and clean way. In fact,
ToXgene's own command line interface (CLI) was redesigned in V2.3
as an external application that operates through the API.
An application uses ToXgene by following thes three steps:
- Start a session, by initializing the data generation engine with
all data generation parameters;
- Parse a template, which translates the TSL notation into an
internal format used by ToXgene (see below);
- Output documents, which consists of instantiating each
tox-document gene inside the input template.
Documentation:
- ToXgene API JavaDoc documentation pages;
- A sample Java application that
reads an input template and accesses ToXgene's API for generating the documents
in that template. This application is also included in the ToXgene package under
the
/samples/API folder.
ToXgene Modules:
Template Parser: the parser converts each input template into
an internal representation that is used by the data generation engine.
This module is also responsible for checking the integrity of the templates,
which includes checking that all operands in all query expressions are of the
appropriate types.
ToXgene Reporter: the reporter provides the bridge between the data
generation engine and the user, by reporting all important events that happen
during the processing of the template. Three kinds of messages are reported:
progress reports, warnings (e.g., a missing value which ToXgene can fill-in with
a predefined default), or critical erros that cause ToXgene to abort the session
(e.g., detecting an inconsistency in a template).
Gene Processor: this is the front-end to the actual data generation
engine. It allows the application to instantiate each XML document into a
given
PrintStream
Java object. That is, the API allows the documents to be materialized into
e.g., a file on disk or a string object in memory. This module is responsible for
the processing of queries and for the materialization of all tox-lists
that are necessary for answering queries.
|