package DTA;
use Moose;
use namespace::autoclean;

use Catalyst::Runtime 5.80;

# Set flags and add plugins for the application.
#
# Note that ORDERING IS IMPORTANT here as plugins are initialized in order,
# therefore you almost certainly want to keep ConfigLoader at the head of the
# list if you're using it.
#
#         -Debug: activates the debug mode for very useful log messages
#   ConfigLoader: will load the configuration from a Config::General file in the
#                 application's home directory
# Static::Simple: will serve static files from the application's root
#                 directory

use Catalyst qw/
    ConfigLoader
    Static::Simple

    I18N

    Session::DynamicExpiry
    Session
    Session::Store::DBI
    Session::State::Cookie

    FillInForm
    FormValidator

/;

extends 'Catalyst';

our $VERSION = '0.02';

# Configure the application.

__PACKAGE__->config(
    name => 'DTA',
    encoding => 'UTF-8',
    enable_catalyst_header => 0,
    using_frontend_proxy => 1,
    # Disable deprecated behavior needed by old applications
    disable_component_resolution_regex_fallback => 1,
    'Plugin::Session' => {
        # storage     => '/tmp/dtaq/sessions',
        # cache_depth => 5,
        # dbic_class => 'DTAQDB::Session',  # Assuming MyApp::Model::DBIC
        dbi_dbh   => 'DTADB',
        expires    => 3600,

    },
    'Plugin::Static::Simple' => {
        include_path => [
            __PACKAGE__->config->{root},
            __PACKAGE__->config->{dtadoc},

        ],
        mime_types => {
            ico => 'image/x-icon',
        },
        ignore_extensions => [ qw(tt xslt xsl pl sh) ],
    },
);

__PACKAGE__->setup();

1;
__END__

=head1 NAME

DTA - Catalyst based application

=head1 SYNOPSIS

    script/dta_server.pl

=head1 SEE ALSO

L<DTA::Controller::Root>, L<Catalyst>

=head1 AUTHOR

Frank Wiegand
Markus Raulf <markus.raulf@gmail.com>

=head1 LICENSE

This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.

=cut
