add custom form
[scpubgit/stemmaweb.git] / lib / stemmaweb.pm
CommitLineData
b8a92065 1package stemmaweb;
2use Moose;
3use namespace::autoclean;
4
5use Catalyst::Runtime 5.80;
6
16562d80 7use Search::GIN::Extract::Class;
8use Search::GIN::Extract::Attributes;
9use Search::GIN::Extract::Multiplex;
10
b8a92065 11# Set flags and add plugins for the application.
12#
13# Note that ORDERING IS IMPORTANT here as plugins are initialized in order,
14# therefore you almost certainly want to keep ConfigLoader at the head of the
15# list if you're using it.
16#
17# -Debug: activates the debug mode for very useful log messages
18# ConfigLoader: will load the configuration from a Config::General file in the
19# application's home directory
20# Static::Simple: will serve static files from the application's root
21# directory
22
23use Catalyst qw/
b8a92065 24 ConfigLoader
25 Static::Simple
16562d80 26 Authentication
27 Session
28 Session::Store::File
29 Session::State::Cookie
19262e3d 30 StatusMessage
12566320 31 StackTrace
b8a92065 32/;
33
34extends 'Catalyst';
35
36our $VERSION = '0.01';
37
38# Configure the application.
39#
40# Note that settings in stemmaweb.conf (or other external
41# configuration file that you set up manually) take precedence
42# over this when using ConfigLoader. Thus configuration
43# details given here can function as a default configuration,
44# with an external configuration file acting as an override for
45# local deployment.
46
47__PACKAGE__->config(
48 name => 'stemmaweb',
49 # Disable deprecated behavior needed by old applications
50 disable_component_resolution_regex_fallback => 1,
532cc23b 51 # Set Unicode as the default
52 encoding => 'UTF-8',
b8a92065 53 default_view => 'TT',
54 'View::JSON' => {
55 expose_stash => 'result',
56 },
43ad4ba4 57 'View::TT' => {
58 INCLUDE_PATH => [
59 stemmaweb->path_to( 'root', 'src' ),
60 ],
61 },
16562d80 62 ## kiokudb auth store testing
63 'Plugin::Authentication' => {
b1d9ab02 64 form_handler => '+stemmaweb::Authentication::FormHandler',
16562d80 65 default => {
66 credential => {
67 class => 'Password',
68 password_field => 'password',
69 password_type => 'self_check',
70 },
71 store => {
72 class => 'Model::KiokuDB',
5a9859b7 73 model_name => 'Directory',
16562d80 74 },
19262e3d 75 },
76 openid => {
77 credential => {
78 class => 'OpenID',
51cece70 79 extensions => ['http://openid.net/srv/ax/1.0' =>
80 {
81 ns => 'ax',
82 uri => 'http://openid.net/srv/ax/1.0',
83 mode => 'fetch_request',
84 required => 'email',
bafbd9ae 85 'type.email' => 'http://axschema.org/contact/email',
86 # type => {
87 # email => 'http://axschema.org/contact/email'
88 # }
51cece70 89 }
90 ],
19262e3d 91 },
92 store => {
93 class => 'Model::KiokuDB',
1412c8fc 94 model_name => 'Directory',
19262e3d 95 },
96 auto_create_user => 1,
97 },
85990daf 98 google => {
99 credential => {
100 class => '+stemmaweb::Authentication::Credential::Google',
101 },
102 store => {
103 class => 'Model::KiokuDB',
104 model_name => 'Directory',
105 }
106 },
19262e3d 107 },
108 ## Auth with CatalystX::Controller::Auth
109 'Controller::Users' => {
110 model => 'User',
111 login_id_field => 'username',
112 login_db_field => 'username',
eb38afbc 113 action_after_login => '/users/success',
114 action_after_register => '/users/success',
bec03a85 115 enable_sending_register_email => 0,
eb38afbc 116 register_email_from => '"Stemmaweb" <stemmaweb@byzantini.st>',
b13cb1e8 117 register_email_subject => 'Registration to stemmaweb',
118 register_email_template_plain => 'register-plain.tt',
b600c671 119 realm => 'default',
75daf982 120 login_fields => { openid => [qw/openid_identifier/],
b600c671 121 default => [qw/username password remember/],
b1d9ab02 122 google => [qw/email id_token/],
19262e3d 123 },
16562d80 124 },
b13cb1e8 125 'View::Email::Template' => {
126 stash_key => 'email_template',
127 },
b74843e5 128
129 recaptcha => {
eb38afbc 130 pub_key => '6LfR19MSAAAAACy2meHvLfZGRn3PM2rRYIAfh665',
131 priv_key => '6LfR19MSAAAAAMlQb8BdyecWNRE1bAL2YSgz2sah',
b74843e5 132 },
b8a92065 133);
134
135# Start the application
136__PACKAGE__->setup();
137
138
139=head1 NAME
140
141stemmaweb - Catalyst based application
142
143=head1 SYNOPSIS
144
145 script/stemmaweb_server.pl
146
147=head1 DESCRIPTION
148
149[enter your description here]
150
151=head1 SEE ALSO
152
153L<stemmaweb::Controller::Root>, L<Catalyst>
154
155=head1 AUTHOR
156
157Tara L Andrews
158
159=head1 LICENSE
160
161This library is free software. You can redistribute it and/or modify
162it under the same terms as Perl itself.
163
164=cut
165
1661;