When a transformation flow takes input from a source which is not a stream (file, network, database...) or must output some information directly to such a location, there is a need for basic "transformations" achieving this simple task. This is useful when generating a full web site from source elements.

Generators (and serializers) are the most basic built-in components. They are transformations with no input and one output (and one input and no output respectively).

 [ generator icon ]

Generators

The generate element introduces the use of a generator in a process body. Its structure is the following:

<generate type="type" id="id" out="channel"> {<with-param>}* </generate>

In the bibliographic example, the transformation flows always get their data from files bibexmo.xml and je.xml. These files are read through the use of the generate element:

<generate type="readfile" id="bibexmo" out="R1"/> <with-param name="file">biblio/bibexmo.xml</with-param> </generate> <generate type="readfile" id="je" out="R2"/> <with-param name="file">biblio/je.xml</with-param> </generate>

 [ serializer icon ]

Serializers

The serialize element introduces the use of a serializer in a process body. Its structure is the following:

<serialize type="type" id="id" in="channel"> {<with-param>}* </serialize>

In the bibliographic example, the transformation flows always output its results to the files biblio.html, biblio.bib, biblio-xml.html and tb-biblio.html via the serialize elements:

<serialize type="writefile" id="writeHTML" in="X31"/> <with-param name="file">biblio/biblio.xml</with-param> </serialize> <serialize type="writefile" id="writeBIB" in="Y31"/> <with-param name="file">biblio/biblio.bib</with-param> </serialize> <serialize type="writefile" id="writeXML" in="Z31"/> <with-param name="file">biblio/biblio.xml</with-param> </serialize> <serialize type="writefile" id="writeTB" in="W3"/> <with-param name="file">biblio/biblio_tb.html</with-param> </serialize>

Serializing enables, for instance, reading a file from the file system or the Internet. It can also generate XML from a database.

Next chapter: Dispatchers


Feel free to comment to transmorpher-dev@fluxmedia.fr, Last modified: Tue May 29 14:16:53 CEST 2001
$Id: generators.html,v 1.2 2001/10/10 07:29:23 jerome Exp $