# -------------------------------------------------------------------------------------
# flo::plugin::Error
# -------------------------------------------------------------------------------------
#
#       Author : Jean-Michel Hiver (jhiver@cisedi.com).
#    Copyright : (c) MKDoc Holdings Ltd, 2001
# 
#      Unauthorized modification, use, reuse, distribution or redistribution
#      of this module is stricly forbidden
#
#    Description:
#
#      This module is invoked when the query could not be processed, and returns
#      a 404 page
#
# -------------------------------------------------------------------------------------
package flo::plugin::Error;
use flo::HTTP::Header;
use flo::Template;
use flo::Standard;
use strict;


##
# $class->main;
# -------------
#   Checks that the document exists, returns a 404 page if it doesn't
##
sub main
{
    my $class = shift;
    my $cgi = cgi;
    
    my $document_table = table ('Document');
    my $document = $document_table->get ( Full_Path => path_info );
    
    if (not $document)
    {
      flo::HTTP::Header->out
	  ( new flo::Template (file => 'error/404.html', hash => {}) );
	return 'TERMINATE';
    }
}


1;
