Taxi::Mysql::Format::Template - hit list formatter via Text::Template


NAME

Taxi::Mysql::Format::Template - hit list formatter via Text::Template

(Back to Top)


SYNOPSIS

 ##========================================================================
 ## PRELIMINARIES
 use Taxi::Mysql::Format::Template;
 ##========================================================================
 ## Constructors etc.
 $q = $CLASS_OR_OBJ->new(%args);
 ##========================================================================
 ## Format API
 $str = $obj->toString($hl);
 $bool = $obj->toFh($hl,$fh);
 ##========================================================================
 ## Template API: Template acquisition
 \%params  = $obj->templateParams($hl, %more);
 $type     = $fmt->templateType();
 $src      = $fmt->templateSource();
 $template = $fmt->template();

(Back to Top)


DESCRIPTION

Globals etc.

Variable: @ISA

Taxi::Mysql::Format::Template inherits from and implements the API specified by Taxi::Mysql::Format::Base.

Constructors etc.

new
 $q = $CLASS_OR_OBJ->new(%args);

Object structure / known %args:

   {
    ##-- Template data
    templateType   => $type,             ##-- source type: 'FILE','ARRAY','FILEHANDLE','STRING'
    templateSource => $src,              ##-- template source data
    templateParams => \%params,          ##-- also: $fmt, $hl, $ix, $q
    templateDelim  => [ $open, $close ], ##-- default: '@{', '@}'
    ##-- Source data (from ../Format)
    index  => $index,     ##-- underlying Taxi::Mysql object
   }

Format API

toString
 $str = $obj->toString($hl);

(undocumented)

toFh
 $bool = $obj->toFh($hl,$fh);

(undocumented)

Template API: Template acquisition

templateParams
 \%params = $obj->templateParams($hl, %more);

Should return user Text::Template parameters. Default implementation instantiates the following parameters:

 $fmt ##-- the calling Taxi::Mysql::Format::Template object
 $hl  ##-- the Taxi::Mysql::HitList object to be formatted
 $ix  ##-- the Taxi::Mysql index associated with the formatter object
 $q   ##-- the Taxi::Mysql::Query::Base object associated with the HitList
templateType
 $type = $fmt->templateType();

TYPE argument to Text::Template->new(). Default: 'STRING'.

templateSource
 $src = $fmt->templateSource();

SOURCE argument to Text::Template->new(). Default: '@{ ``$hl'' @}'

template
 $template = $fmt->template();

Gets a (new) Text::Template for formatting. Default implementation uses $fmt->{template} if defined.

(Back to Top)


ACKNOWLEDGEMENTS

Perl by Larry Wall.

(Back to Top)


AUTHOR

Bryan Jurish <moocow@ling.uni-potsdam.de>

(Back to Top)


COPYRIGHT AND LICENSE

Copyright (C) 2006 by Bryan Jurish

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

(Back to Top)


SEE ALSO

perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Format(3perl), Taxi::Mysql::Format::Text(3perl), Taxi::Mysql::Format::XML(3perl), Taxi::Mysql::Format::XSLT(3perl), Taxi::Mysql::Format::HTML(3perl).

(Back to Top)

 Taxi::Mysql::Format::Template - hit list formatter via Text::Template