METHODS

See METHODS in Mail::Reporter

Constructors

$class->new( OPTIONS )
Option Defined in Default

formatter

HTML::FromMail::Format::OODoc

log

Mail::Reporter

'WARNINGS'

producers

<some basic items>

settings

{}

templates

'.'

trace

Mail::Reporter

'WARNINGS'

formatter => CLASS|OBJECT|HASH
The formatter which is used to process the template files which produce the output.
You can specify a CLASS, a formatter OBJECT, or a HASH with options for a HTML::FromMail::Format::OODoc object which will be created for you.
log => LEVEL
producers => HASH
The producer list describes which set of formatting commands are applicable to certain objects when producing HTML. The HASH maps external classes (usually implemented in Mail::Box) to sub-classes of this object. You may modify the default list using producer(). Read more in Producers.
settings => HASH
Each producer has defaults for formatting flexability. For instance, sometimes alternatives are available for creating certain pieces of HTML. This option adds/modifies the settings for a certain group of producers, but influence the formatters behavior as well. Read more in Settings.
templates => DIRECTORY
The location where the template files can be found. It is used as base for relative names.
trace => LEVEL
» Error: Formatter $class can not be used: $@
» Error: Formatter $class could not be instantiated

Error handling

$obj->AUTOLOAD
See AUTOLOAD in Mail::Reporter.
$obj->addReport( $object )
See addReport in Mail::Reporter.
$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
$class->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
See defaultTrace in Mail::Reporter.
$obj->errors
See errors in Mail::Reporter.
$obj->log( [$level, [$strings]] )
$class->log( [$level, [$strings]] )
See log in Mail::Reporter.
$obj->logPriority( $level )
$class->logPriority( $level )
See logPriority in Mail::Reporter.
$obj->logSettings
See logSettings in Mail::Reporter.
$obj->notImplemented
See notImplemented in Mail::Reporter.
$obj->report( [$level] )
See report in Mail::Reporter.
$obj->reportAll( [$level] )
See reportAll in Mail::Reporter.
$obj->trace( [$level] )
See trace in Mail::Reporter.
$obj->warnings
See warnings in Mail::Reporter.

Cleanup

$obj->DESTROY
See DESTROY in Mail::Reporter.

Attributes

$obj->formatter

Returns the selected formatter object.

$obj->producer( (CLASS|OBJECT) [, HTML_PRODUCER] )

The CLASS object, for instance a Mail::Message, is handled by the HTML_PRODUCER class. When an OBJECT is specified, the class of that object will be used. The producer returned is the best fit with respect of the inheritance relations. undef is returned when no producer was found.

Without producer as parameter, the actual producer for the CLASS is returned. In this case, the producer class will be compiled for you, if that hasn't be done before.

» Example:
 use HTML::FromMail;
 my $converter = HTML::FromMail->new;
 print $converter->producer("Mail::Message");

 print $converter->producer($msg);
» Error: Cannot use $producer for $class: $@

The specified producer (see new(producers)) does not exist or produces compilation errors. The problem is displayed.

$obj->settings( (PRODUCER|TOPIC) [,HASH|LIST] )

Returns a hash which contains the differences from the default for producers of a certain TOPIC, or the topic of the specified PRODUCER. With HASH, all settings will be replaced by that value as new set.

It may be easier to use new(settings) or add the information to the content of your templates.

$obj->templates( [PRODUCER|TOPIC] )

Returns the location of the templates. When a TOPIC is specified, that is added to the templates path. With a PRODUCER, that is object is used to get the topic.

» Error: Cannot find template file or directory $topic in $directory.

The templates directory (see new(templates)) does not contain a template for the specified topic (see HTML::FromMail::Object::new(topic)).

Export

$obj->export( OBJECT, OPTIONS )

Produce the HTML output of the OBJECT, using the specified OPTIONS.

Option Default

output

<required>

use

undef

output => DIRECTORY|FILENAME
The DIRECTORY where the processed templates for the object are written to. It is only permitted to supply a single filename when the template specifies a single filename as well.
use => ARRAY-OF-FILENAMES
Directoy new(templates) defines the location of all template files. In that directort, you have sub-directories for each kind of object which can be formatted sorted on topic.
for instance, templates contains /home/me/templates and the object is a Mail::Message which is handled by HTML::FromMail::Message which has topic message. This directory plus the topic result in the directory path /home/me/templates/message/. By default, all the files found in there get formatted. However, when the use option is provided, only the specified files are taken. If that filename is related, it is relative to the templates direcory. If the filename is absolute (starts with a slash), that name is used.
» Error: No output directory or file specified.
» Error: No producer for $class objects.
» Warning: No templates for $topic objects.
» Warning: No templates found in $templates directory

Other methods

$obj->expandFiles( DIRECTORY|FILENAME|ARRAY-OF-FILENAMES )

Returns a list with all filenames which are included in the DIRECTORY specified or the ARRAY. If only one FILENAME is specified, then that will be returned.

» Warning: Cannot find $dir/file
» Error: Cannot read from directory $thing: $!
» Warning: Skipping $full, which is neither file or directory.