NAME
/content/transform/apply_transformation - Applies file content transformations
DESCRIPTION
This module performs several tasks. The primary purpose of this module is to take generated content in some format A and find a way to transform that data into format A'.
The format of the content is given in the $context via $context->original_kind. The "kind" is just a name for some format (not a MIME-type or anything fancy, just a name). The "kind" the content should be coerced into is determined by the request itself and the configuration of Contentment. This module attempts to find zero or more transformations that will coerce the document of the original kind into a document of the final kind. These transformations can be file format converters (e.g. XML -> PDF) or merely thematic formatters, or even just bits of code that modify nothing, but log some information. Whatever.
The importance is that each transformer accept data from one or more input kinds and produces a document of a single output kind. Transformers are Mason components. They must have the @input_kinds and the $output_kind attributes defined to the names of the input kinds and output kind of the transformer, respectively. Each transformer must also define a $cost attribute, which associates a numeric cost to the transformation---the higher the value the more "costly" the transformation. This module will attempt to use the cheapest transformation available, but may use any found.
AUTHOR
Andrew Sterling Hanenkamp, <hanenkamp@users.sourceforge.net>
COPYRIGHT AND LICENSE
Copyright 2005 Andrew Sterling Hanenkamp. All Rights Reserved.
Contentment is distributed under the same license and terms as Perl itself.