Name

Bric::App::PreviewHandler - Special Apache handlers used for local previewing.

Synopsis

<Perl>
    if (PREVIEW_LOCAL) {
        $PerlTransHandler = 'Bric::App::PreviewHandler::uri_handler';
        if (PREVIEW_MASON) {
            $PerlFixupHandler = 'Bric::App::PreviewHandler::fixup_handler';
        }
    }
</Perl>

Description

This package is the main package used by Apache for managing the Bricolage application. It loads all the necessary Mason and Bricolage libraries and sets everything up for use in Apache. It is one function is handler(), which is called by mod_perl for every request.

Interface

Constructors

NONE.

Destructors

NONE.

Public Class Methods

NONE.

Public Functions

my $status = uri_handler()

Handles the URI Translation phase of the Apache request if the PREVIEW_LOCAL directive is true. Otherwise unused. It's job is to ensure that files requested directly from the preview directory (/data/preview) as if they were requested from the document root (/) are directed to the correct file.

Throws: NONE.

Side Effects: This handler will slow Bricolage, as it will be executing a fair bit of extra code on every request. It is thus recommended to use a separate server for previews.

Notes: NONE.

my $status = fixup_handler()

Runs after the MIME-checking request phase so that, if the content-type is not text/html. Only used when both the PREVIEW_LOCAL and PREVIEW_MASON directives have been enabled, as it will prevent Mason from munging non-Mason files such as images.

Throws: NONE.

Side Effects: This handler will slow Bricolage, as it will be executing a fair bit of extra code on every request. It is thus recommended to use a separate server for previews, or to disable Mason for previews on the Bricolage server.

Notes: NONE.

my $status = handle_err($r, $err)

Handles errors for the other handlers in this class.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

Private

Private Class Methods

NONE.

Private Instance Methods

NONE.

Private Functions

NONE.

Notes

NONE.

Author

David Wheeler <david@justatheory.com>

See Also

Bric