The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OpenInteract2::ContentGenerator - Coordinator for classes generating content

SYNOPSIS

# In server startup

OpenInteract2::ContentGenerator->initialize;

# Whenever you want a generator use either of these. (This is handled
# behind the scenes in OI2::Action->generate_content for most uses.)

my $generator = OpenInteract2::ContentGenerator->instance( 'TT' );
my $generator = CTX->content_generator( 'TT' );
$content = $generator->execute( \%template_params,
                                \%content_params,
                                \%template_source );

DESCRIPTION

This is a simple coordinating front end for the classes that actually generate the content -- template processors, SOAP response generators, etc. (You could probably put some sort of image generation in here too, but that would be mad.)

METHODS

Class Methods

initialize()

Normally only called from OpenInteract2::Setup -- call the initialize() method of each generator specified in the configuration key content_generator.

Returns: nothing. If errors occur in the generator classes we log them.

instance( $generator_name )

Return an object representing the given content generator. If $generator_name is not found an exception is thrown.

Returns: an OpenInteract2::ContentGenerator object.

Object Methods

execute( \%template_params, \%content_params, \%template_source )

Passes along the parameters to the appropriate content generator class and return the content.

COPYRIGHT

Copyright (c) 2002-2003 Chris Winters. All rights reserved.

AUTHORS

Chris Winters <chris@cwinters.com>