SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Ado
(framework for web-projects on Mojolicious)
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Table of Contents
●
What is it?
●
What it provides?
●
Minimal Core
●
Plugins
●
Commands
●
Applications
●
Demo
●
Credits
●
Contributors? Investors? Sponsors?
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
●
Ado is:
–
busy or delaying activity; bustle; fuss - суматоха, бъркотия,
суетня. http://www.thefreedictionary.com/ado
–
Yet another Perl module on CPAN: https://metacpan.org/pod/Ado
–
A set of mojo commands: ~/$ ado adduser
–
A (Mojolicious) application:
require Mojolicious::Commands;
Mojolicious::Commands->start_app('Ado');
–
A CMS!, A CRM!, An ERP!..
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
●
Ado's purpose is to quickly put together a web
application based on Mojolicious with scalability,
performance and growth in mind.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
●
An Ado system starts as a lightweight but well
structured application that can turn into an ERP,
a CMS, a CRM or all in one by just adding
plugins along the way, as the organization,
which is using it grows.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What is it?
Linux, Mac OSX, Free BSD, Windows...
Perl SQLite, MySQL, Postgre SQL
Mojolicious
Ado framework = Ado App + Mojolicious Plugins
Ado-based applications
Ado::Plugin::Vest
Ado::Plugin::Site
Ado::Plugin::Admin
Ado::Plugin::Shop
Ado::Plugin::Store
Ado::Plugin::XYZ
Layers / Blocks
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What it provides?
●
Glue code, that you otherwise write every time
you start a new Mojolicious project.
●
Default configuration in etc/ado.conf.
●
Database in etc/ado.sqlite. MySQL or
PostgreSQL can be used.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What it provides?
●
Default name-space for controllers:
Ado::Control::*. You can use your own.
●
Model: Ado::Model::* based on
DBIx::Simple::Class. You can generate your
classes on the fly.
●
Additional Commands: Ado::Command::*.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
What it provides?
●
Examples – Ado is a Mojolicious application,
aiming to be a good example.
●
Semantic-UI CSS/JS framework in
public/vendor/Semantic-UI.
●
Always up to date with latest Mojolicious!
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Minimal Core
●
Ado strives to provide just the code that you
otherwise have to write with every next
Mojolicious project.
●
Bundled Semantic-UI for UI.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Minimal Core
●
Additional assets (CSS, JS, templates) are
optional.
Mojolicious::Plugin::AssetPack can be used to
manage them.
●
All plugins are (should be) optional. Use them if
you wish!
●
Enough to start a personal site in minutes.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Any Mojolicious::Plugin::* can be used.
●
Ado::Plugin is the base class for Ado plugins.
It allows you to use plugin-specific and
mode-specific configuration files:
–
Ado/etc/plugins/routes.conf
–
Ado/etc/plugins/routes.development.conf
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
JSON and Perl configuration file formats are
supported.
●
Any configuration format is supported as long as
Mojolicious::Plugin::XYZConfig follows the Mojo
API.
●
Every Ado plugin ISA Mojolicious::Plugin!
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::I18n localizes your application and site.
–
automatically detects the current UserAgent language preferences
–
Options can be set in etc/ado.conf or in etc/plugins/i18n.conf:
–
language_from_route => 1, # eg. /bg/news/list
–
language_from_host => 1, # eg. fr.example.com
–
language_from_param => 1, # eg. ?language=de
–
language_from_cookie => 1, # eg. Cookie: language=bg;
–
language_from_headers => 1, # eg. Accept-Language: bg,fr;q=0.8,en-us;q=0.5,en;q=0.3
–
Helpers:
–
l() - <%= l('hello', user->name) %>
–
language() - Allows you to (re)set the current language. No need to use this helper!
–
It is called automatically in Mojolicious/around_action hook.
–
Storage of translation entries in the database is planned.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::Routes allows you to define your routes in a
separate file $MOJO_HOME/etc/plugins/routes.conf.
●
In the configuration file you can also use the app keyword
and add complex routes as you would do directly in the
code.
●
Options:
–
routes => [
–
{route => '/ado-users', via => ['GET'],
–
to => 'ado-users#list',},
–
...
–
],
–
base_url_path =>'/'
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::MarkdownRenderer is a markdown
renderer.
●
Text::MultiMarkdown is the default renderer. Support for
other is planned.
●
Create a controller and use the md_to_html helper.
See Ado::Control::Doc for an example.
●
Many options. See the docs.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::MarkdownRenderer Helpers:
–
markdown - Accepts markdown text and options. Returns
HTML.
#in a template
%==markdown($text)
–
md_to_html
<%= md_to_html($file_path) %>
% #<article>$html</article>
–
%# using $c->stash('md_file')
<%= md_to_html() %>
% #<article>$html</article>
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::Auth authenticates users to an Ado system.
●
Users can be authenticated locally or (TODO!) using
Facebook, Google, Twitter and other authentication
service-providers.
●
Mojolicious::Plugin::OAuth2 is planned as dependency.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Plugins
●
Ado::Plugin::AdoHelpers will be a collection of helpers
for Ado if we need even more.
●
Mojolicious::Plugin::DefaultHelpers,
Mojolicious::Plugin::TagHelpers
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::version shows version information for
installed core and optional modules.
–
$ ado version
–
ADO:
–
0.55 - U+2C04 GLAGOLITIC CAPITAL LETTER DOBRO ( )Ⰴ
–
Thanks for testing a development release, you are awesome!
–
CORE
–
Perl (v5.18.2, linux)
–
Mojolicious (5.18, Tiger Face)
–
OPTIONAL
–
EV 4.0+ (4.17)
–
IO::Socket::IP 0.20+ (0.29)
–
IO::Socket::SSL 1.84+ (1.962)
–
This version is up to date, have fun!
–
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::adduser adds a user to an Ado
application. It is a facade for Ado::Model::Users.
●
$ ado adduser
USAGE:
# Minimal required options to add a user
bin/ado adduser --login_name USERNAME --email user@example.com
--first_name John --last_name Smith
# Add a user to an additional group
bin/ado adduser --login_name USERNAME --ingroup GROUPNAME
# Change password / disable a user
bin/ado adduser --login_name USERNAME --ingroup GROUPNAME --disabled
--login_password !@#$%^&
See perldoc Ado::Command::adduser for full set of options.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::generate::apache2vhost generates a
minimal Apache2 Virtual Host configuration file for your
Ado application.
●
On the command-line:
$ bin/ado generate apache2vhost --ServerName example.com -s 
> etc/001-example.com.vhost.conf
In your code:
use Ado::Command::generate::apache2vhost;
my $vhost = Ado::Command::generate::apache2vhost->new;
$vhost->run('--ServerName' => 'example.com', '-p' => 8080);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::generate::apache2htaccess
generates an Apache2 .htaccess configuration
file. Use this command on a shared hosting too.
–
ado generate apache2htaccess --module cgi,fcgid 
> .htaccess
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
Ado::Command::generate::adoplugin generates
an Ado::Plugin.
–
$ ado generate adoplugin --name MyBlog
–
$ ado generate adoplugin --name MyBlog –crud 
-t 'articles,news'
●
Ado::Command::generate::crud generates MVC
set of files.
–
$ ado generate crud --tables='news,articles'
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Commands
●
dsc_dump_schema.pl is a script to dump a schema
from a database. Comes with DBIx::Simple::Class.
●
#dump all tables
dsc_dump_schema.pl --dsn
DBI:mysql:database=mydb;host=127.0.0.1;mysql_enable_utf8=1 
-u me -p mypassword --overwrite 1 --lib_root ./lib
●
#or dump only the "users" table - using short options and
choosing a namespace
dsc_dump_schema.pl -dsn dbi:SQLite:database=etc/ado.sqlite 
-n Ado::Model -l lib -t users
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Applications
●
Entire custom applications can be created by just using
your own plugins.
●
You can directly inherit Ado. Ado ISA Mojolicious.
●
Use Mojolicious Plugins
–
Preferably written by someone of the Mojolicious core
development-team.
–
Look in the code and decide if it is well written.
–
Make sure it is often updated and works with latest Mojo.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Contributors? Investors? Sponsors?
●
See Ado::Manual::Contributing.
●
Hire me to implement your Ideas.
●
Use Ado and report issues.
●
Convince your boss Ado worths it.
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Credits
●
Вълчо Неделчев (Valcho Nedelchev)
–
Helped by writing code, moral support and feedback.
●
Станислав Лечев (Stanislav Lechev)
–
Helped by providing free hosting for the Ado demo site
http://ado.0xaf.org/, moral support and feedback.
●
You?
–
Ideas, feature requests, code, design, Mojo mastery...
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Create one or more tables to be used by your plugin.
●
CREATE TABLE blog (
id INTEGER PRIMARY KEY,
title VARCHAR NOT NULL UNIQUE,
body TEXT NOT NULL,
published BOOL DEFAULT '0',
deleted BOOL NOT NULL DEFAULT '0',
user_id INTEGER REFERENCES users(id),
group_id INTEGER REFERENCES groups(id),
permissions VARCHAR(10) DEFAULT '-rwxr-xr-xr'
);
CREATE INDEX blog_published ON blog(published);
CREATE INDEX blog_deleted ON blog(deleted);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Add some dummy records.
●
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey','Hello world',3,3);
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey You','Hello Universe',3,3);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Generate your plugin:
●
$ ado generate adoplugin -n Blog --crud -t blog
●
[mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin/Blog.pm
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Control/Blog.pm
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/list.html.ep
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/create.html.ep
…
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/t/plugin/blog-00.t
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/Build.PL
[mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins
[write] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/blog.conf
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Add some dummy records.
●
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey','Hello world',3,3);
INSERT INTO blog(title,body,user_id,group_id)
VALUES('Hey You','Hello Universe',3,3);
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Copy blog.conf to blog.development.conf and edit blog.development.conf
●
$ ado generate adoplugin -n Blog --crud -t blog
●
cd /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/
●
cp blog.conf blog.development.conf
●
Edit etc/ado.development.conf to make Ado know about
it:
●
plugins => [
…
'blog',
]
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
Run Ado with your new plugin to see if it works.
●
$ export PERL5LIB=$HOME/opt/public_dev/Ado-Plugin-Blog/lib:$PERL5LIB
●
$ ado daemon
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Demo
●
It works:
●
© Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria
http://i-can.eu
ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ
АБ
ВГ
ДЕ
ЖЗ
ИЙ
КЛ
МН
ОП
РС
ТУ
ФХ
ЦЧ
ШЩ
ЪЬ
ЮЯ
Благодаря!
●
Thanks!
●
Merci!
●
Díky!!
●
Multumesc!
●
Спасибо!

Contenu connexe

Plus de Krasimir Berov (Красимир Беров) (16)

Хешове
ХешовеХешове
Хешове
 
Списъци и масиви
Списъци и масивиСписъци и масиви
Списъци и масиви
 
Скаларни типове данни
Скаларни типове данниСкаларни типове данни
Скаларни типове данни
 
Въведение в Perl
Въведение в PerlВъведение в Perl
Въведение в Perl
 
System Programming and Administration
System Programming and AdministrationSystem Programming and Administration
System Programming and Administration
 
Network programming
Network programmingNetwork programming
Network programming
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Working with databases
Working with databasesWorking with databases
Working with databases
 
Working with text, Regular expressions
Working with text, Regular expressionsWorking with text, Regular expressions
Working with text, Regular expressions
 
Subroutines
SubroutinesSubroutines
Subroutines
 
IO Streams, Files and Directories
IO Streams, Files and DirectoriesIO Streams, Files and Directories
IO Streams, Files and Directories
 
Syntax
SyntaxSyntax
Syntax
 
Hashes
HashesHashes
Hashes
 
Lists and arrays
Lists and arraysLists and arrays
Lists and arrays
 
Scalar data types
Scalar data typesScalar data types
Scalar data types
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 

Dernier

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 

Dernier (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 

Ado (framework for web-projects on Mojolicious)

  • 1. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Ado (framework for web-projects on Mojolicious)
  • 2. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Table of Contents ● What is it? ● What it provides? ● Minimal Core ● Plugins ● Commands ● Applications ● Demo ● Credits ● Contributors? Investors? Sponsors?
  • 3. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? ● Ado is: – busy or delaying activity; bustle; fuss - суматоха, бъркотия, суетня. http://www.thefreedictionary.com/ado – Yet another Perl module on CPAN: https://metacpan.org/pod/Ado – A set of mojo commands: ~/$ ado adduser – A (Mojolicious) application: require Mojolicious::Commands; Mojolicious::Commands->start_app('Ado'); – A CMS!, A CRM!, An ERP!..
  • 4. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? ● Ado's purpose is to quickly put together a web application based on Mojolicious with scalability, performance and growth in mind.
  • 5. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? ● An Ado system starts as a lightweight but well structured application that can turn into an ERP, a CMS, a CRM or all in one by just adding plugins along the way, as the organization, which is using it grows.
  • 6. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What is it? Linux, Mac OSX, Free BSD, Windows... Perl SQLite, MySQL, Postgre SQL Mojolicious Ado framework = Ado App + Mojolicious Plugins Ado-based applications Ado::Plugin::Vest Ado::Plugin::Site Ado::Plugin::Admin Ado::Plugin::Shop Ado::Plugin::Store Ado::Plugin::XYZ Layers / Blocks
  • 7. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What it provides? ● Glue code, that you otherwise write every time you start a new Mojolicious project. ● Default configuration in etc/ado.conf. ● Database in etc/ado.sqlite. MySQL or PostgreSQL can be used.
  • 8. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What it provides? ● Default name-space for controllers: Ado::Control::*. You can use your own. ● Model: Ado::Model::* based on DBIx::Simple::Class. You can generate your classes on the fly. ● Additional Commands: Ado::Command::*.
  • 9. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ What it provides? ● Examples – Ado is a Mojolicious application, aiming to be a good example. ● Semantic-UI CSS/JS framework in public/vendor/Semantic-UI. ● Always up to date with latest Mojolicious!
  • 10. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Minimal Core ● Ado strives to provide just the code that you otherwise have to write with every next Mojolicious project. ● Bundled Semantic-UI for UI.
  • 11. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Minimal Core ● Additional assets (CSS, JS, templates) are optional. Mojolicious::Plugin::AssetPack can be used to manage them. ● All plugins are (should be) optional. Use them if you wish! ● Enough to start a personal site in minutes.
  • 12. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Any Mojolicious::Plugin::* can be used. ● Ado::Plugin is the base class for Ado plugins. It allows you to use plugin-specific and mode-specific configuration files: – Ado/etc/plugins/routes.conf – Ado/etc/plugins/routes.development.conf
  • 13. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● JSON and Perl configuration file formats are supported. ● Any configuration format is supported as long as Mojolicious::Plugin::XYZConfig follows the Mojo API. ● Every Ado plugin ISA Mojolicious::Plugin!
  • 14. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::I18n localizes your application and site. – automatically detects the current UserAgent language preferences – Options can be set in etc/ado.conf or in etc/plugins/i18n.conf: – language_from_route => 1, # eg. /bg/news/list – language_from_host => 1, # eg. fr.example.com – language_from_param => 1, # eg. ?language=de – language_from_cookie => 1, # eg. Cookie: language=bg; – language_from_headers => 1, # eg. Accept-Language: bg,fr;q=0.8,en-us;q=0.5,en;q=0.3 – Helpers: – l() - <%= l('hello', user->name) %> – language() - Allows you to (re)set the current language. No need to use this helper! – It is called automatically in Mojolicious/around_action hook. – Storage of translation entries in the database is planned.
  • 15. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::Routes allows you to define your routes in a separate file $MOJO_HOME/etc/plugins/routes.conf. ● In the configuration file you can also use the app keyword and add complex routes as you would do directly in the code. ● Options: – routes => [ – {route => '/ado-users', via => ['GET'], – to => 'ado-users#list',}, – ... – ], – base_url_path =>'/'
  • 16. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::MarkdownRenderer is a markdown renderer. ● Text::MultiMarkdown is the default renderer. Support for other is planned. ● Create a controller and use the md_to_html helper. See Ado::Control::Doc for an example. ● Many options. See the docs.
  • 17. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::MarkdownRenderer Helpers: – markdown - Accepts markdown text and options. Returns HTML. #in a template %==markdown($text) – md_to_html <%= md_to_html($file_path) %> % #<article>$html</article> – %# using $c->stash('md_file') <%= md_to_html() %> % #<article>$html</article>
  • 18. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::Auth authenticates users to an Ado system. ● Users can be authenticated locally or (TODO!) using Facebook, Google, Twitter and other authentication service-providers. ● Mojolicious::Plugin::OAuth2 is planned as dependency.
  • 19. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Plugins ● Ado::Plugin::AdoHelpers will be a collection of helpers for Ado if we need even more. ● Mojolicious::Plugin::DefaultHelpers, Mojolicious::Plugin::TagHelpers
  • 20. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::version shows version information for installed core and optional modules. – $ ado version – ADO: – 0.55 - U+2C04 GLAGOLITIC CAPITAL LETTER DOBRO ( )Ⰴ – Thanks for testing a development release, you are awesome! – CORE – Perl (v5.18.2, linux) – Mojolicious (5.18, Tiger Face) – OPTIONAL – EV 4.0+ (4.17) – IO::Socket::IP 0.20+ (0.29) – IO::Socket::SSL 1.84+ (1.962) – This version is up to date, have fun! –
  • 21. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::adduser adds a user to an Ado application. It is a facade for Ado::Model::Users. ● $ ado adduser USAGE: # Minimal required options to add a user bin/ado adduser --login_name USERNAME --email user@example.com --first_name John --last_name Smith # Add a user to an additional group bin/ado adduser --login_name USERNAME --ingroup GROUPNAME # Change password / disable a user bin/ado adduser --login_name USERNAME --ingroup GROUPNAME --disabled --login_password !@#$%^& See perldoc Ado::Command::adduser for full set of options.
  • 22. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::generate::apache2vhost generates a minimal Apache2 Virtual Host configuration file for your Ado application. ● On the command-line: $ bin/ado generate apache2vhost --ServerName example.com -s > etc/001-example.com.vhost.conf In your code: use Ado::Command::generate::apache2vhost; my $vhost = Ado::Command::generate::apache2vhost->new; $vhost->run('--ServerName' => 'example.com', '-p' => 8080);
  • 23. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::generate::apache2htaccess generates an Apache2 .htaccess configuration file. Use this command on a shared hosting too. – ado generate apache2htaccess --module cgi,fcgid > .htaccess
  • 24. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● Ado::Command::generate::adoplugin generates an Ado::Plugin. – $ ado generate adoplugin --name MyBlog – $ ado generate adoplugin --name MyBlog –crud -t 'articles,news' ● Ado::Command::generate::crud generates MVC set of files. – $ ado generate crud --tables='news,articles'
  • 25. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Commands ● dsc_dump_schema.pl is a script to dump a schema from a database. Comes with DBIx::Simple::Class. ● #dump all tables dsc_dump_schema.pl --dsn DBI:mysql:database=mydb;host=127.0.0.1;mysql_enable_utf8=1 -u me -p mypassword --overwrite 1 --lib_root ./lib ● #or dump only the "users" table - using short options and choosing a namespace dsc_dump_schema.pl -dsn dbi:SQLite:database=etc/ado.sqlite -n Ado::Model -l lib -t users
  • 26. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Applications ● Entire custom applications can be created by just using your own plugins. ● You can directly inherit Ado. Ado ISA Mojolicious. ● Use Mojolicious Plugins – Preferably written by someone of the Mojolicious core development-team. – Look in the code and decide if it is well written. – Make sure it is often updated and works with latest Mojo.
  • 27. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Contributors? Investors? Sponsors? ● See Ado::Manual::Contributing. ● Hire me to implement your Ideas. ● Use Ado and report issues. ● Convince your boss Ado worths it.
  • 28. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Credits ● Вълчо Неделчев (Valcho Nedelchev) – Helped by writing code, moral support and feedback. ● Станислав Лечев (Stanislav Lechev) – Helped by providing free hosting for the Ado demo site http://ado.0xaf.org/, moral support and feedback. ● You? – Ideas, feature requests, code, design, Mojo mastery...
  • 29. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Create one or more tables to be used by your plugin. ● CREATE TABLE blog ( id INTEGER PRIMARY KEY, title VARCHAR NOT NULL UNIQUE, body TEXT NOT NULL, published BOOL DEFAULT '0', deleted BOOL NOT NULL DEFAULT '0', user_id INTEGER REFERENCES users(id), group_id INTEGER REFERENCES groups(id), permissions VARCHAR(10) DEFAULT '-rwxr-xr-xr' ); CREATE INDEX blog_published ON blog(published); CREATE INDEX blog_deleted ON blog(deleted);
  • 30. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Add some dummy records. ● INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey','Hello world',3,3); INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey You','Hello Universe',3,3);
  • 31. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Generate your plugin: ● $ ado generate adoplugin -n Blog --crud -t blog ● [mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Plugin/Blog.pm [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/lib/Ado/Control/Blog.pm [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/list.html.ep [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/site_templates/blog/create.html.ep … [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/t/plugin/blog-00.t [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/Build.PL [mkdir] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins [write] /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/blog.conf
  • 32. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Add some dummy records. ● INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey','Hello world',3,3); INSERT INTO blog(title,body,user_id,group_id) VALUES('Hey You','Hello Universe',3,3);
  • 33. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Copy blog.conf to blog.development.conf and edit blog.development.conf ● $ ado generate adoplugin -n Blog --crud -t blog ● cd /home/berov/opt/public_dev/Ado-Plugin-Blog/etc/plugins/ ● cp blog.conf blog.development.conf ● Edit etc/ado.development.conf to make Ado know about it: ● plugins => [ … 'blog', ]
  • 34. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● Run Ado with your new plugin to see if it works. ● $ export PERL5LIB=$HOME/opt/public_dev/Ado-Plugin-Blog/lib:$PERL5LIB ● $ ado daemon
  • 35. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Demo ● It works: ●
  • 36. © Красимир Беров (Krasimir Berov), YAPC::Europe 2014, Sofia, Bulgaria http://i-can.eu ⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰣⰤⰥⰦⰧⰨⰩⰪⰮ АБ ВГ ДЕ ЖЗ ИЙ КЛ МН ОП РС ТУ ФХ ЦЧ ШЩ ЪЬ ЮЯ Благодаря! ● Thanks! ● Merci! ● Díky!! ● Multumesc! ● Спасибо!