Bric::App::PreviewHandler(3)

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

VERSION
$LastChangedRevision$

DATE
$LastChangedDate: 2006-08-30 07:04:14 +0200 (Wed, 30 Aug 2006) $

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 set to true, 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