OpusVL::AppKit
version 2.24
AppKit is based on CatalystX::AppBuilder, and includes some modules for common tasks. The idea is that you produce a thin AppKit application, and stick multiple modules together.
We recommend Dist::Zilla to get you started on AppKit. That's because we've made minting profiles so we don't have to explain how it works.
$ dzil new -PAppKit MyApp $ dzil new -PAppKitX MyApp::AppKitX::NewModularFeature
See Dist::Zilla::MintingProfile::AppKit and Dist::Zilla::MintingProfile::AppKitX.
Whenever you mint a new AppKit application, you'll end up with a common set of files:
MyApp.pm:
package MyApp; use strict; use warnings; use MyApp::Builder; our $VERSION='0.001'; my $builder = MyApp::Builder->new( appname => __PACKAGE__, version => $VERSION ); $builder->bootstrap; 1;
MyApp/Builder.pm:
(see also "Builder")
package MyApp::Builder; use Moose; extends 'OpusVL::AppKit::Builder'; override _build_superclasses => sub { return [ 'OpusVL::AppKit' ] }; override _build_config => sub { my $self = shift; my $config = super(); $config->{'Controller::Login'} = { traits => '+OpusVL::AppKit::TraitFor::Controller::Login::NewSessionIdOnLogin', }; $config->{'View::CMS::Page'}->{AUTO_FILTER} = 'html'; return $config; };
myapp.conf:
name MyApp <Model::CMS> connect_info dbi:SQLite:t/db/test.db connect_info username connect_info password </Model::CMS> <Model::AppKitAuthDB> connect_info dbi:SQLite:t/db/test.db connect_info username connect_info password </Model::AppKitAuthDB>
OpusVL::AppKit - Catalyst based application
AppKitX is the namespace we use for the individual modules from which your application is built. Each of this is almost an entire Catalyst application per se; except that it doesn't inherit from Catalyst itself, and requires marshalling by means of a Builder class.
We generally recommend keeping things as separate as possible, so we normally have:
AppKitX
DB
AppKitX::DB
For example, once we've created MyApp, we would create MyApp::AppKitX::SomeModule, MyApp::DB, and MyApp::AppKitX::DB.
MyApp
MyApp::AppKitX::SomeModule
MyApp::DB
MyApp::AppKitX::DB
There will be many MyApp::AppKitX::SomeModule style distributions; and possibly some MyCompany::AppKitX::SomeModule distributions, for common modules.
MyCompany::AppKitX::SomeModule
The builder is provided as a skeleton, but this is where you decide which modules get loaded. To do so, you override a method in MyApp/Builder.pm.
MyApp/Builder.pm
override _build_plugins => sub { my $plugins = super(); return [ @$plugins, qw/ MyApp::AppKitX::Plugin1 MyApp::AppKitX::Plugin2 / ]; }
This is all that's required to connect those plugins together - an app with a builder with this method, listing them.
Support can be garnered by use of the GitHub issue tracker at https://github.com/OpusVL/OpusVL-AppKit/issues
OpusVL - www.opusvl.com
This software is copyright (c) 2010 by OpusVL - www.opusvl.com.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OpusVL::AppKit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpusVL::AppKit
CPAN shell
perl -MCPAN -e shell install OpusVL::AppKit
For more information on module installation, please visit the detailed CPAN module installation guide.