« blib/lib/Excel/Template/Plus/TTAutoFilter.pm
↑ Summary
blib/lib/OpusVL/AppKit/Plugin/AppKit/Node.pm »
| 1 | package OpusVL::AppKit; | ||
| 2 | |||
| 3 | |||
| 4 | 10 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 10 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 10 | ▶ | use OpusVL::AppKit::Builder; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 10 | our $VERSION = '2.24'; | |
| 8 | |||
| 9 | 10 | my $builder = OpusVL::AppKit::Builder->new( appname => __PACKAGE__, version => $VERSION ); | |
| 10 | 10 | $builder->bootstrap; | |
| 11 | |||
| 12 | 10 | 1; | |
| 13 | |||
| 14 | __END__ | ||
| 15 | |||
| 16 | =pod | ||
| 17 | |||
| 18 | =encoding UTF-8 | ||
| 19 | |||
| 20 | =head1 NAME | ||
| 21 | |||
| 22 | OpusVL::AppKit | ||
| 23 | |||
| 24 | =head1 VERSION | ||
| 25 | |||
| 26 | version 2.24 | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | AppKit is based on L<CatalystX::AppBuilder>, and includes some modules for | ||
| 31 | common tasks. The idea is that you produce a thin AppKit application, and stick | ||
| 32 | multiple modules together. | ||
| 33 | |||
| 34 | We recommend L<Dist::Zilla> to get you started on AppKit. That's because we've | ||
| 35 | made minting profiles so we don't have to explain how it works. | ||
| 36 | |||
| 37 | $ dzil new -PAppKit MyApp | ||
| 38 | $ dzil new -PAppKitX MyApp::AppKitX::NewModularFeature | ||
| 39 | |||
| 40 | See L<Dist::Zilla::MintingProfile::AppKit> and L<Dist::Zilla::MintingProfile::AppKitX>. | ||
| 41 | |||
| 42 | Whenever you mint a new AppKit application, you'll end up with a common set of files: | ||
| 43 | |||
| 44 | F<MyApp.pm>: | ||
| 45 | |||
| 46 | package MyApp; | ||
| 47 | use strict; | ||
| 48 | use warnings; | ||
| 49 | use MyApp::Builder; | ||
| 50 | |||
| 51 | our $VERSION='0.001'; | ||
| 52 | |||
| 53 | my $builder = MyApp::Builder->new( | ||
| 54 | appname => __PACKAGE__, | ||
| 55 | version => $VERSION | ||
| 56 | ); | ||
| 57 | |||
| 58 | $builder->bootstrap; | ||
| 59 | |||
| 60 | 1; | ||
| 61 | |||
| 62 | F<MyApp/Builder.pm>: | ||
| 63 | |||
| 64 | (see also L</Builder>) | ||
| 65 | |||
| 66 | package MyApp::Builder; | ||
| 67 | use Moose; | ||
| 68 | extends 'OpusVL::AppKit::Builder'; | ||
| 69 | override _build_superclasses => sub | ||
| 70 | { | ||
| 71 | return [ 'OpusVL::AppKit' ] | ||
| 72 | }; | ||
| 73 | |||
| 74 | override _build_config => sub | ||
| 75 | { | ||
| 76 | my $self = shift; | ||
| 77 | my $config = super(); | ||
| 78 | |||
| 79 | $config->{'Controller::Login'} = | ||
| 80 | { | ||
| 81 | traits => '+OpusVL::AppKit::TraitFor::Controller::Login::NewSessionIdOnLogin', | ||
| 82 | }; | ||
| 83 | |||
| 84 | $config->{'View::CMS::Page'}->{AUTO_FILTER} = 'html'; | ||
| 85 | |||
| 86 | return $config; | ||
| 87 | }; | ||
| 88 | |||
| 89 | F<myapp.conf>: | ||
| 90 | |||
| 91 | name MyApp | ||
| 92 | |||
| 93 | <Model::CMS> | ||
| 94 | connect_info dbi:SQLite:t/db/test.db | ||
| 95 | connect_info username | ||
| 96 | connect_info password | ||
| 97 | </Model::CMS> | ||
| 98 | |||
| 99 | <Model::AppKitAuthDB> | ||
| 100 | connect_info dbi:SQLite:t/db/test.db | ||
| 101 | connect_info username | ||
| 102 | connect_info password | ||
| 103 | </Model::AppKitAuthDB> | ||
| 104 | |||
| 105 | =head1 NAME | ||
| 106 | |||
| 107 | OpusVL::AppKit - Catalyst based application | ||
| 108 | |||
| 109 | =head1 AppKitX | ||
| 110 | |||
| 111 | AppKitX is the namespace we use for the individual modules from which your | ||
| 112 | application is built. Each of this is almost an entire Catalyst application per | ||
| 113 | se; except that it doesn't inherit from Catalyst itself, and requires | ||
| 114 | marshalling by means of a Builder class. | ||
| 115 | |||
| 116 | We generally recommend keeping things as separate as possible, so we normally have: | ||
| 117 | |||
| 118 | =over | ||
| 119 | |||
| 120 | =item An C<AppKitX> distribution for each logical chunk of the site | ||
| 121 | |||
| 122 | =item A C<DB> distribution, usually a L<DBIx::Class> distribution that stands | ||
| 123 | independently of the application itself | ||
| 124 | |||
| 125 | =item An C<AppKitX::DB> distribution, which provides the L<Catalyst::Model> for | ||
| 126 | the aforementioned C<DB> distribution. | ||
| 127 | |||
| 128 | =back | ||
| 129 | |||
| 130 | For example, once we've created C<MyApp>, we would create | ||
| 131 | C<MyApp::AppKitX::SomeModule>, C<MyApp::DB>, and C<MyApp::AppKitX::DB>. | ||
| 132 | |||
| 133 | There will be many C<MyApp::AppKitX::SomeModule> style distributions; and | ||
| 134 | possibly some C<MyCompany::AppKitX::SomeModule> distributions, for common | ||
| 135 | modules. | ||
| 136 | |||
| 137 | =head1 Builder | ||
| 138 | |||
| 139 | The builder is provided as a skeleton, but this is where you decide which | ||
| 140 | modules get loaded. To do so, you override a method in C<MyApp/Builder.pm>. | ||
| 141 | |||
| 142 | override _build_plugins => sub { | ||
| 143 | my $plugins = super(); | ||
| 144 | return [ @$plugins, qw/ | ||
| 145 | MyApp::AppKitX::Plugin1 | ||
| 146 | MyApp::AppKitX::Plugin2 | ||
| 147 | / ]; | ||
| 148 | } | ||
| 149 | |||
| 150 | This is all that's required to connect those plugins together - an app with a | ||
| 151 | builder with this method, listing them. | ||
| 152 | |||
| 153 | =head1 SEE ALSO | ||
| 154 | |||
| 155 | =over | ||
| 156 | |||
| 157 | =item L<OpusVL::AppKit::Plugin::AppKit> | ||
| 158 | |||
| 159 | =item L<OpusVL::AppKit::Base::Controller::GUI> | ||
| 160 | |||
| 161 | =item L<OpusVL::AppKit::Controller::Root> | ||
| 162 | |||
| 163 | =item L<Catalyst> | ||
| 164 | |||
| 165 | =back | ||
| 166 | |||
| 167 | =head1 SUPPORT | ||
| 168 | |||
| 169 | Support can be garnered by use of the GitHub issue tracker at | ||
| 170 | L<https://github.com/OpusVL/OpusVL-AppKit/issues> | ||
| 171 | |||
| 172 | =head1 AUTHOR | ||
| 173 | |||
| 174 | OpusVL - www.opusvl.com | ||
| 175 | |||
| 176 | =head1 COPYRIGHT AND LICENSE | ||
| 177 | |||
| 178 | This software is copyright (c) 2010 by OpusVL - www.opusvl.com. | ||
| 179 | |||
| 180 | This is free software; you can redistribute it and/or modify it under | ||
| 181 | the same terms as the Perl 5 programming language system itself. | ||
| 182 | |||
| 183 | =cut | ||